Structure, sample, and savor hyperparameter searches
Project description
pyrameter
pyrameter
is a library for designing hierarchical parameter searches with
continuous and discrete domains, and then search those spaces.
Installation
$ git clone https://github.com/jeffkinnison/pyrameter
$ cd pyrameter
$ pip install .
Dependencies
numpy
scipy
scikit-learn
pymongo
dill
six
A Short Example
import math
import pyrameter
# Minimize the sin function
def objective(params):
return math.sin(params['x'])
# Uniformly sample values over [0, pi]
space = {
'x': pyrameter.uniform(0, math.pi),
}
# Set up the search with an experiment key, the domains to search, and
# random search to generate values.
opt = pyrameter.FMin('sin_exp', space, 'random')
# Try 1000 values of x and store the result.
for i in range(1000):
trial = opt.generate()
trial.objective = objective(trial.hyperparameters)
# Print the x that minimized sin
print(opt.optimum)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyrameter-0.3.0.post1.tar.gz
(27.0 kB
view hashes)
Built Distribution
Close
Hashes for pyrameter-0.3.0.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b341d184055ce633886f413e516524387dde256d0ab7f45f1ccabdf6c544c84 |
|
MD5 | c693b07a2d9b269ae4dc6ab45cbabf15 |
|
BLAKE2b-256 | b85729d1fcf9014c6941b78908f47bdb85f4b37cbd0907d52925d4fa3da4f3b5 |