Skip to content

Instantly share code, notes, and snippets.

@dvas0004
Created March 18, 2016 15:53
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 dvas0004/0d41c6c4b6ea1f8ed37a to your computer and use it in GitHub Desktop.
Save dvas0004/0d41c6c4b6ea1f8ed37a to your computer and use it in GitHub Desktop.
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