Created
September 30, 2012 19:58
-
-
Save bayerj/3808298 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
| import spearmint | |
| exp = spearmint.Experiment() | |
| exp.add_variable('n_hiddens', min=1, max=100, type=int) | |
| for i in range(100): # Do 100 trials. | |
| id, args = exp.draw() # Get a new candidate; id is used as a handle for later pushing back results into the experiment. | |
| cost = f(args) # Evaluate objective. | |
| exp.push(id, cost) # Push results into the experiment so we get a new candidate based on those results in the next iteration. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment