runlmc.parameterization.parameterized module¶
This module contains the Parameterized class.
It only exists for convenience, documentation, and to
indicate which methods of the corresponding paramz
class should be used.
-
class
runlmc.parameterization.parameterized.Parameterized(name=None, parameters=[])[source]¶ Bases:
paramz.parameterized.Parameterized,runlmc.parameterization.priorizable._PriorizableNodeA
Parameterizedclass is responsible for keeping track of which parameters it is dependent on.It does NOT manage updates for those parameters if they change during some optimization process. The
runlmc.parametrization.Modelshould take care of that.Say m is a handle to a parameterized class.
Printing parameters:
- print(m) prints a nice summary over all parameters
- print(name) prints details for param with name name
- print(m[regexp]) prints details for all the parameters which match regexp
- print(m[‘’]) prints details for all parameters
Getting and setting parameters:
m.subparameterized1.subparameterized2.param[:] = 1
Handling of constraining, fixing and tieing parameters:
You can constrain parameters by calling the constrain on the param itself, e.g:
m.name[:,1].constrain_positive() m.name[0].tie_to(m.name[1])
Fixing parameters will fix them to the value they are right now. If you change the parameters value, the param will be fixed to the new value!
If you want to operate on all parameters use m[‘’] to wildcard select all parameters and concatenate them. Printing m[‘’] will result in printing of all parameters in detail.
-
link_parameter(param, index=None)[source]¶ Indicate that a class depends on a certain parameter, and therefore should include it in gradient computations, and change it during, e.g, model optimization.
Note
Unless you’re creating your own parameters, you shouldn’t need to call this.
Parameters: - param – the parameter to add.
- [index] – index of where to put parameters
Raises: TypeError – if param is not the runlmc (priorizable) parameter.