Package paramz :: Module ties_and_remappings :: Class Tie
[hide private]
[frames] | no frames]

Class Tie

source code


The new parameter tie framework. (under development)

All the parameters tied together get a new parameter inside the *Tie* object. Its value should always be equal to all the tied parameters, and its gradient is the sum of all the tied parameters.

Implementation Details:

The *Tie* object should only exist on the top of param tree (the highest parent).

self.label_buf: It uses a label buffer that has the same length as all the parameters (self._highest_parent_.param_array). The buffer keeps track of all the tied parameters. All the tied parameters have a label (an interger) higher than 0, and the parameters that have the same label are tied together.

self.buf_index: An auxiliary index list for the global index of the tie parameter inside the *Tie* object.

.. warning:

   This is not implemented yet and will be different, with high degree of certainty.
   Do not use!
Instance Methods [hide private]
 
__init__(self, name='tie')
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
getTieFlag(self, p=None) source code
 
_init_labelBuf(self) source code
 
_updateTieFlag(self) source code
 
add_tied_parameter(self, p, p2=None)
Tie the list of parameters p together (p2==None) or Tie the list of parameters p with the list of parameters p2 (p2!=None)
source code
 
_merge_tie_param(self, ids)
Merge the tie parameters with ids in the list.
source code
 
_sync_val_group(self, idx) source code
 
_expandTieParam(self, num)
Expand the tie param with the number of *num* parameters
source code
 
_removeTieParam(self, idx)
idx within tied_param
source code
 
_expand_label_buf(self, idx_old, idx_new)
Expand label buffer accordingly
source code
 
_shrink_label_buf(self, idx_old, idx_new, bool_list) source code
 
_check_change(self) source code
 
parameters_changed(self)
This method gets called when parameters have changed.
source code
 
collate_gradient(self) source code
 
propagate_val(self) source code

Inherited from parameterized.Parameterized: __getitem__, __setattr__, __setitem__, __setstate__, __str__, _repr_html_, build_pydot, copy, get_property_string, grep_param_names, link_parameter, link_parameters, unlink_parameter

Inherited from core.parameter_core.Parameterizable: disable_caching, enable_caching, initialize_parameter, save, traverse, traverse_parents

Inherited from core.parameter_core.OptimizationHandlable: parameter_names, parameter_names_flat, randomize

Inherited from core.constrainable.Constrainable: constrain, constrain_bounded, constrain_fixed, constrain_negative, constrain_positive, fix, unconstrain, unconstrain_bounded, unconstrain_fixed, unconstrain_negative, unconstrain_positive, unfix

Inherited from core.indexable.Indexable: add_index_operation, remove_index_operation

Inherited from core.nameable.Nameable: hierarchy_name

Inherited from core.gradcheckable.Gradcheckable: checkgrad

Inherited from core.gradcheckable.Gradcheckable (private): _checkgrad

Inherited from core.pickleable.Pickleable: __deepcopy__, __getstate__, pickle

Inherited from core.parentable.Parentable: has_parent

Inherited from core.updateable.Updateable: toggle_update, trigger_update, update_model, update_toggle

Inherited from core.observable.Observable: add_observer, change_priority, notify_observers, remove_observer, set_updates

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __subclasshook__

Class Variables [hide private]

Inherited from core.parentable.Parentable: _parent_, _parent_index_

Properties [hide private]

Inherited from parameterized.Parameterized: flattened_parameters

Inherited from parameterized.Parameterized (private): _description_str

Inherited from core.parameter_core.Parameterizable: gradient, num_params, param_array, unfixed_param_array

Inherited from core.parameter_core.OptimizationHandlable: gradient_full, optimizer_array

Inherited from core.constrainable.Constrainable: is_fixed

Inherited from core.nameable.Nameable: name

Inherited from core.parentable.Parentable: _highest_parent_

Inherited from object: __class__

Method Details [hide private]

__init__(self, name='tie')
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

parameters_changed(self)

source code 

This method gets called when parameters have changed. Another way of listening to param changes is to add self as a listener to the param, such that updates get passed through. See :py:function:``paramz.param.Observable.add_observer``

Overrides: core.parameter_core.Parameterizable.parameters_changed
(inherited documentation)