Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lr and decay are deprecated in Keras optimizer- braai_train.ipynb #8

Open
DRA-chaos opened this issue Oct 21, 2023 · 0 comments
Open

Comments

@DRA-chaos
Copy link

lr and decay are deprecated in Keras optimizer, using learning_rate corrects the warning.

The corrected code for the cell I presume is :
model = vgg6(input_shape=image_shape, n_classes=n_classes)

Set up optimizer:

if optimizer == 'adam':
optimizer = tf.keras.optimizers.Adam(learning_rate=3e-4, beta_1=0.9, beta_2=0.999, epsilon=None, amsgrad=False)
elif optimizer == 'sgd':
optimizer = tf.keras.optimizers.SGD(learning_rate=0.01, momentum=0.9, decay=1e-6, nesterov=True)
else:
print('Could not recognize optimizer, using Adam')
optimizer = tf.keras.optimizers.Adam(learning_rate=3e-4, beta_1=0.9, beta_2=0.999, epsilon=None, amsgrad=False)

model.compile(optimizer=optimizer, loss=loss, metrics=['accuracy'])

print(model.summary())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant