Created
November 8, 2019 04:42
-
-
Save analyticsindiamagazine/414f3b977277c7f31af089b0856bf3ca 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
#The hyperparameters & their values to be tested are stored in aspecial type called HParam | |
HP_NUM_UNITS = hp.HParam('num_units', hp.Discrete([50, 100, 200])) | |
HP_DROPOUT = hp.HParam('dropout', hp.RealInterval(0.1, 0.3)) | |
HP_OPTIMIZER = hp.HParam('optimizer', hp.Discrete(['adam', 'sgd','nadam'])) | |
#Settinf the Metric to RMSE | |
METRIC_RMSE = 'RootMeanSquaredError' | |
#Clear any logs from previous runs | |
!rm -rf ./logs/ | |
#Creating & configuring log files | |
with tf.summary.create_file_writer('logs/hparam_tuning').as_default(): | |
hp.hparams_config( | |
hparams=[HP_NUM_UNITS, HP_DROPOUT, HP_OPTIMIZER], | |
metrics=[hp.Metric(METRIC_RMSE, display_name='RMSE')] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment