44A hyper-parameter library for researchers, data scientists and machine learning engineers.
55
66Quick Start
7- ============
7+ -----------
88
9- ## Object-Style API:
9+ ### Object-Style API:
1010
1111``` python
1212>> > from hyperparameter import HyperParameter
1919
2020```
2121
22- or becomes powerful with ` hp() ` :
22+ If we want safe access to undefined parameters with default values, we can use ` hp() ` instead of ` hp ` :
2323
2424``` python
2525>> > hp = HyperParameter()
@@ -34,7 +34,7 @@ or becomes powerful with `hp()`:
3434
3535```
3636
37- ## Scoped Parameter
37+ ### Scoped Parameter
3838
3939``` python
4040>> > from hyperparameter import param_scope
@@ -45,7 +45,8 @@ or becomes powerful with `hp()`:
4545True
4646
4747```
48- or becomes powerful with ` nested scope ` :
48+
49+ When nested, the parameter modifications are limited to the inner scope:
4950``` python
5051>> > with param_scope(a = 1 ) as ps:
5152... with param_scope(a = 2 ) as ps2:
5657
5758```
5859
59- even more powerful when using ` param_scope ` in function :
60+ The nested scope feature can be used to config the default behavior when used in functions :
6061
6162``` python
6263# change function behavior with scoped parameter:
63- def foo ( arg ):
64+ def dnn ( input ):
6465 # receive parameter using param_scope
65- with param_scope() as ps:
66- if (ps().param1(1 ) == 1 ):
67- return 1
68- else :
69- return 2
70- ...
66+ with param_scope() as ps:
67+ output = linear(inputs)
68+ return activation_fn(
69+ output,
70+ activation = ps().activation(" relu" ))
7171
7272# call function with default parameter
73- foo() # 1
73+ dnn()
7474
7575# passing parameter using param_scope
76- with param_scope(param1 = 2 ):
77- foo() # 2
76+ with param_scope(activation = " sigmoid " ):
77+ dnn()
7878```
7979
80- ## Predefined Parameter
80+ ### Predefined Parameter
8181``` python
8282@auto_param # convert keyword arguments into hyper parameters
8383def model_train (X , y , learning_rate = 1.0 , penalty = ' l1' ):
@@ -92,18 +92,18 @@ with param_scope('model_train.learning_rate=0.01'):
9292```
9393
9494Examples
95- ========
95+ --------
9696
97- ## [ parameter tunning for researchers] ( examples/sparse_lr/README.md )
97+ ### [ parameter tunning for researchers] ( examples/sparse_lr/README.md )
9898
9999This example shows how to use hyperparameter in your research projects, and make your experiments reproducible.
100100
101- ## [ experiment tracing for data scientists] ( examples/mnist/README.md )
101+ ### [ experiment tracing for data scientists] ( examples/mnist/README.md )
102102
103103This example shows experiment management with hyperparameter, and tracing the results with mlflow.tracing.
104104
105105Todo.
106106
107- ## design-pattern for system engineers
107+ ### design-pattern for system engineers
108108
109109Todo.
0 commit comments