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
pip install pyrameter
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.5.tar.gz
(32.6 kB
view hashes)
Built Distribution
pyrameter-0.3.5-py3-none-any.whl
(48.3 kB
view hashes)
Close
Hashes for pyrameter-0.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94dca3d4065fd48ae7f3abf704bc0d3cba837180d218555c967a076ed49dc20d |
|
MD5 | fced1d2d669c590130d789f4858ea8d9 |
|
BLAKE2b-256 | d590d752b26b551d3379a34c5c51571ec7a5ede6897bb106a4a6b194c9956ff5 |