This section includes information for using the pure Python API of bob.learn.activation.
Returns the directory containing the C/C++ API include directives
Returns a string containing the configuration information.
Bases: object
Base class for activation functors.
Warning
You cannot instantiate an object of this type directly, you must use it through one of the inherited types.
Warning
You cannot create classes in Python that derive from this one and expect them to work fine with the C++ code, as no hook is implemented as of this time to allow for this. You must create a class that inherits from the C++ bob::machine::Activation in C++ and then bind it to Python like we have done for the classes available in these bindings.
Computes the activated value, given an input array or scalar z, placing results in res (and returning it).
If z is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array z. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Computes the derivative of the activated value, given an input array or scalar z, placing results in res (and returning it).
If z is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array z. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Computes the derivative of the activated value, given the derivative value a, placing results in res (and returning it).
If a is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array a. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Loads itself from a bob.io.HDF5File
Saves itself to a bob.io.HDF5File
Returns a unique (string) identifier, used by this class in connection with the Activation registry.
alias of HyperbolicTangentActivation
Bases: bob.learn.activation.Activation
Identity() -> new Identity activation functor
Computes as activation function.
Computes the activated value, given an input array or scalar z, placing results in res (and returning it).
If z is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array z. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Computes the derivative of the activated value, given an input array or scalar z, placing results in res (and returning it).
If z is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array z. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Computes the derivative of the activated value, given the derivative value a, placing results in res (and returning it).
If a is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array a. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Loads itself from a bob.io.HDF5File
Saves itself to a bob.io.HDF5File
Returns a unique (string) identifier, used by this class in connection with the Activation registry.
Bases: bob.learn.activation.Activation
Linear([C=1.0]) -> new linear activation functor
Computes as activation function.
The constructor builds a new linear activation function with a given constant. Don’t use this if you just want to set constant to the default value (1.0). In such a case, prefer to use the more efficient IdentityActivation.
The multiplication factor for the linear function (read-only)
Computes the activated value, given an input array or scalar z, placing results in res (and returning it).
If z is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array z. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Computes the derivative of the activated value, given an input array or scalar z, placing results in res (and returning it).
If z is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array z. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Computes the derivative of the activated value, given the derivative value a, placing results in res (and returning it).
If a is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array a. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Loads itself from a bob.io.HDF5File
Saves itself to a bob.io.HDF5File
Returns a unique (string) identifier, used by this class in connection with the Activation registry.
Bases: bob.learn.activation.Activation
Logistic() -> new Logistic activation functor
Computes as activation function.
Computes the activated value, given an input array or scalar z, placing results in res (and returning it).
If z is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array z. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Computes the derivative of the activated value, given an input array or scalar z, placing results in res (and returning it).
If z is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array z. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Computes the derivative of the activated value, given the derivative value a, placing results in res (and returning it).
If a is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array a. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Loads itself from a bob.io.HDF5File
Saves itself to a bob.io.HDF5File
Returns a unique (string) identifier, used by this class in connection with the Activation registry.
Bases: bob.learn.activation.Activation
MultipliedHyperbolicTangentActivation([C=1.0, [M=1.0]]) -> new multiplied hyperbolic tangent functor
Computes as activation function.
Builds a new hyperbolic tangent activation function with a given constant for the inner and outter products. Don’t use this if you just want to set the constants to the default values (1.0). In such a case, prefer to use the more efficient bob.machine.HyperbolicTangentActivation.
The outter multiplication factor for the multiplied hyperbolic tangent function (read-only).
The inner multiplication factor for the multiplied hyperbolic tangent function (read-only).
Computes the activated value, given an input array or scalar z, placing results in res (and returning it).
If z is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array z. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Computes the derivative of the activated value, given an input array or scalar z, placing results in res (and returning it).
If z is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array z. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Computes the derivative of the activated value, given the derivative value a, placing results in res (and returning it).
If a is an array, then you can pass another array in res to store the results and, in this case, we won’t allocate a new one for that purpose. This can be a speed-up in certain scenarios. Note this does not work for scalars as it makes little sense to avoid scalar allocation at this level.
If you decide to pass an array in res, note this array should have the exact same dimensions as the input array a. It is an error otherwise.
Note
This method only accepts 64-bit float arrays as input or output.
Loads itself from a bob.io.HDF5File
Saves itself to a bob.io.HDF5File
Returns a unique (string) identifier, used by this class in connection with the Activation registry.