Created
March 21, 2020 17:05
-
-
Save miki998/3ed6d33e90a96b6d03d528b2e0460465 to your computer and use it in GitHub Desktop.
fitting for hyperas.py
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
best_run, best_model = optim.minimize(model=create_model, | |
data=data, | |
algo=tpe.suggest, | |
max_evals=5, | |
trials=Trials(), | |
notebook_name='gala_recog') | |
# Evaluate the model on the test data using `evaluate` | |
print('\n# Evaluate on test data') | |
results = best_model.evaluate(X_test, y_test, batch_size=128) | |
print('test loss, test acc:', results) | |
# Generate predictions (probabilities -- the output of the last layer) | |
# on new data using `predict` | |
print('\n# Generate predictions for 3 samples') | |
predictions = best_model.predict(X_test[:3]) | |
print('predictions shape:', predictions.shape) | |
print(best_run) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment