Skip to content

Instantly share code, notes, and snippets.

@jamesonthecrow
Created July 6, 2019 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesonthecrow/8e29631902aa0bf29a586eac1e2d5011 to your computer and use it in GitHub Desktop.
Save jamesonthecrow/8e29631902aa0bf29a586eac1e2d5011 to your computer and use it in GitHub Desktop.
Mobile machine learning with Fritz. https://fritz.ai
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