Skip to content

Instantly share code, notes, and snippets.

@archydeberker
Created April 14, 2019 21:36
Show Gist options
  • Save archydeberker/380757cf933aa0a72ba85355946df225 to your computer and use it in GitHub Desktop.
Save archydeberker/380757cf933aa0a72ba85355946df225 to your computer and use it in GitHub Desktop.
def random_hyperparamters():
""" Returns randomly drawn hyperparamters for our CNN"
hyperparam_dict = {}
hyperparam_dict['lr'] = 10 ** np.random.uniform(-6, -1)
hyperparam_dict['weight_decay'] = 10 ** np.random.uniform(-6, -3)
hyperparam_dict['momentum'] = 10 ** np.random.uniform(-1, 0)
hyperparam_dict['conv1_size'] = int(np.random.uniform(10,100))
hyperparam_dict['conv2_size'] = int(np.random.uniform(10,100))
hyperparam_dict['fc1_size'] = int(np.random.uniform(30,200))
hyperparam_dict['fc2_size'] = int(np.random.uniform(30,200))
return hyperparam_dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment