neon.transforms.transform.Transform

class neon.transforms.transform.Transform(name=None)[source]

Bases: neon.NervanaObject

Base class for activation or cost functions and their derivatives. Child classes can either implement the below __call__ and bprop methods, or alternatively define self.func and self.funcgrad. The latter is typically used for code compactness when the operations can be fit into a lambda function.

__init__(name=None)[source]

Class constructor.

Methods

__init__([name]) Class constructor.
bprop(x) Returns the derivative of f(x).
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
bprop(x)[source]

Returns the derivative of f(x).

Parameters:x (Tensor or OpTree) – input
Returns:computes the derivative of the func(x)
Return type:funcgrad (OpTree)
classnm

Returns the class name.

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