Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. %%time
  2. seed = 7
  3. numpy.random.seed(seed)
  4. batch_size = 128
  5. epochs = 10
  6.  
  7. model_CV = KerasClassifier(build_fn=create_model, epochs=epochs,
  8. batch_size=batch_size, verbose=1)
  9. # define the grid search parameters
  10. init_mode = ['uniform', 'lecun_uniform', 'normal', 'zero',
  11. 'glorot_normal', 'glorot_uniform', 'he_normal', 'he_uniform']
  12.  
  13. param_grid = dict(init_mode=init_mode)
  14. grid = GridSearchCV(estimator=model_CV, param_grid=param_grid, n_jobs=-1, cv=3)
  15. grid_result = grid.fit(x_train, y_train)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement