A hyper-parameter library for researchers, data scientists and machine learning engineers.
Project description
HyperParameter
A hyper-parameter library for researchers, data scientists and machine learning engineers.
Quick Start
Object-Style API:
from hyperparameter import HyperParameter
params = HyperParameter(a=1, b={'c': 2})
params.a == 1 # True
params.b.c == 2 # True (nested parameter)
or becomes powerful with params()
:
params().a.b.c.getOrElse(3) # 3 (default value)
params().a.b.c(3) # 3 (shortcut for default value)
params().a.b.c = 4 # set value to param `a.b.c`
params().a.b.c(3) # 4 (default value is ignored)
Scoped Parameter
from hyperparameter import param_scope
# scoped parameter
with param_scope(a=1) as hp:
hp.a == 1 # True
or becomes powerful with nested scope
:
with param_scope(a=1) as hp:
with param_scope(a=2) as hp:
hp.a == 2 # True, a=2 for inner scope
hp.a == 1 # True, a=1 for outer scope
even more powerful when using param_scope
in function:
#change function behavior with scoped parameter:
def foo(arg):
# receive parameter using param_scope
with param_scope() as hp:
if (hp().param1.getOrElse(1) == 1):
return 1
else:
return 2
...
# call function with default parameter
foo() # 1
# passing parameter using param_scope
with param_scope(param1=2):
foo() # 2
Examples
parameter tunning for researchers
This example shows how to use hyperparameter in your research projects, and make your experiments reproducible.
experiment tracing for data scientists
Todo.
design-pattern for system engineers
Todo.
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
hyperparameter-0.1.3.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for hyperparameter-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4a7621159c707dbd12c2ac2e9cd0993a3b6e98626d3e6258867a1c2f42b8755 |
|
MD5 | 124b3f5d6c11fc85d995e68e1a511f61 |
|
BLAKE2b-256 | 2e868afcf07838dcf42a80f3e958d647e67a1b7f2342f3c8cecea0ebbcd766ec |