Created
March 18, 2016 15:53
-
-
Save dvas0004/0d41c6c4b6ea1f8ed37a to your computer and use it in GitHub Desktop.
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
classifier = skflow.TensorFlowEstimator(model_fn=conv_model, n_classes=outer_name+1, | |
batch_size=10) | |
# use a full grid over all parameters | |
param_grid = {"steps": [1000, 1500, 2000, 2500, 3000], | |
"learning_rate": [0.01, 0.03, 0.05, 0.08], | |
"batch_size": [8, 10, 12]} | |
# run grid search | |
grid_search = GridSearchCV(classifier, param_grid=param_grid, scoring = 'accuracy', verbose=10, n_jobs=-1,cv=2) | |
grid_search.fit(X_train, y_train) | |
print(grid_search) | |
# summarize the results of the grid search | |
print(grid_search.best_score_) | |
print(grid_search.best_params_) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment