Home | Trees | Indices | Help |
---|
|
Parameter object for GPy models.
:param str name: name of the parameter to be printed :param input_array: array which this parameter handles :type input_array: np.ndarray :param default_constraint: The default constraint for this parameter :type default_constraint:
You can add/remove constraints by calling constrain on the parameter itself, e.g:
Fixing parameters will fix them to the value they are right now. If you change the fixed value, it will be fixed to the new value!
Important Notes:
The array given into this, will be used as the Param object. That is, the memory of the numpy array given will be the memory of this object. If you want to make a new Param object you need to copy the input array!
Multilevel indexing (e.g. self[:2][1:]) is not supported and might lead to unexpected behaviour. Try to index in one go, using boolean indexing or the numpy builtin np.index function.
See :py:class:`GPy.core.parameterized.Parameterized` for more details on constraining etc.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Deep copy of array |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|
|||
a new object with type S, a subtype of T |
|
|
|||
__array_priority__ = -1 Array priority. |
|||
_fixes_ = None hash(x) |
|||
parameters =
|
|||
Inherited from Inherited from |
|
|||
param_array As we are a leaf, this just returns self |
|||
values Return self as numpy array view |
|||
gradient Return a view on the gradient, which is in the same shape as this parameter is. |
|||
is_fixed | |||
_description_str | |||
flattened_parameters | |||
num_params Return the number of parameters of this parameter_handle. |
|||
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
None.
|
x[y]
|
Flattened array of ints, specifying the index of this object. This has to account for shaped parameters!
|
get the raveled index for a param that is an int array, containing the indexes for the flattened param inside this parameterized logic. !Warning! be sure to call this method on the highest parent of a hierarchy, as it uses the fixes to do its work
|
|
|
Make a copy. This means, we delete all observers and return a copy of this array. It will still be an ObsAr!
|
Used if copy.deepcopy is called on an array.
|
Setup the default observers 1: pass through to parent, if present
|
Get the names of all parameters of this model or parameter. It starts from the parameterized object you are calling this method on. Note: This does not unravel multidimensional parameters, use parameter_names_flat to unravel parameters! :param bool add_self: whether to add the own name in front of names :param bool adjust_for_printing: whether to call `adjust_name_for_printing` on names :param bool recursive: whether to traverse through hierarchy and append leaf node names :param bool intermediate: whether to add intermediate names, that is parameterized objects
|
repr(x)
|
str(x)
|
Build a pydot representation of this model. This needs pydot installed. Example Usage: np.random.seed(1000) X = np.random.normal(0,1,(20,2)) beta = np.random.uniform(0,1,(2,1)) Y = X.dot(beta) m = RidgeRegression(X, Y) G = m.build_pydot() G.write_png('example_hierarchy_layout.png') The output looks like: .. image:: example_hierarchy_layout.png Rectangles are parameterized objects (nodes or leafs of hierarchy). Trapezoids are param objects, which represent the arrays for parameters. Black arrows show parameter hierarchical dependence. The arrow points from parents towards children. Orange arrows show the observer pattern. Self references (here) are the references to the call to parameters changed and references upwards are the references to tell the parents they need to update. |
|
param_arrayAs we are a leaf, this just returns self
|
valuesReturn self as numpy array view
|
gradientReturn a view on the gradient, which is in the same shape as this parameter is. Note: this is not the real gradient array, it is just a view on it. To work on the real gradient array use: self.full_gradient
|
is_fixed
|
_description_str
|
flattened_parameters
|
num_paramsReturn the number of parameters of this parameter_handle. Param objects will always return 0.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Jul 4 11:59:53 2017 | http://epydoc.sourceforge.net |