neon.initializers.initializer.IdentityInit

class neon.initializers.initializer.IdentityInit(local=True, name='Identity')[source]

Bases: neon.initializers.initializer.Initializer

Initializes parameters with the identity matrix.

__init__(local=True, name='Identity')[source]

Class constructor.

Parameters:
  • local (bool, optional) – Whether the layer type is local (Convolutional) or not. Default is True.
  • name (string, optional) – Name to assign an instance of this class.

Methods

__init__([local, name]) Class constructor.
fill(param) Fill the provided tensor with the identity matrix.
gen_class(pdict)
get_description([skip]) Returns a dict that contains all necessary information needed to serialize this object.
recursive_gen(pdict, key) helper method to check whether the definition
be = None
classnm

Returns the class name.

fill(param)[source]

Fill the provided tensor with the identity matrix.

Parameters:params (tensor) – Tensor to fill
gen_class(pdict)
get_description(skip=[], **kwargs)

Returns a dict that contains all necessary information needed to serialize this object.

Parameters:skip (list) – Objects to omit from the dictionary.
Returns:Dictionary format for object information.
Return type:(dict)
modulenm

Returns the full module path.

recursive_gen(pdict, key)

helper method to check whether the definition dictionary is defining a NervanaObject child, if so it will instantiate that object and replace the dictionary element with an instance of that object