Created
July 6, 2019 14:02
-
-
Save jamesonthecrow/8e29631902aa0bf29a586eac1e2d5011 to your computer and use it in GitHub Desktop.
Mobile machine learning with Fritz. https://fritz.ai
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keras.backend.clear_session() | |
# Retrain the model with our new configuration and callback | |
model = build_model() | |
model.compile( | |
keras.optimizers.Adam(lr=metadata['learning_rate']), | |
loss=keras.losses.sparse_categorical_crossentropy, | |
metrics=[keras.metrics.sparse_categorical_accuracy] | |
) | |
model.fit( | |
x_train[:, :, :, None], | |
y_train[:, None], | |
epochs=5, | |
batch_size=metadata['batch_size'], | |
validation_split=0.05, | |
callbacks=[fritz_callback] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment