Created
September 13, 2018 21:57
-
-
Save SkalskiP/8964912137acd442a8efbecc91324700 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Auxiliary function creating graph of classification boundaries | |
| def save_model_prediction_graph(epoch, logs): | |
| prediction_probs = model.predict_proba(grid_2d, batch_size=32, verbose=0) | |
| plt.figure(figsize=(10,10)) | |
| sns.set_style("whitegrid") | |
| plt.title('Binary classification with KERAS - epoch: ' + makeIndexOfLength(epoch, 3), fontsize=20) | |
| plt.xlabel('X', fontsize=15) | |
| plt.ylabel('Y', fontsize=15) | |
| plt.contourf(X, Y, prediction_probs.reshape(100, 100), alpha = 0.7, cmap=cm.Spectral) | |
| plt.scatter(X_train[:, 0], X_train[:, 1], c=y_train.ravel(), s=50, cmap=plt.cm.Spectral, edgecolors='black') | |
| plt.savefig("./" + OUTPUT_DIR + "/keras" + makeIndexOfLength(epoch, 3) + ".png") | |
| plt.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment