Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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