ActivationFunctions

ActivationFunctions.relu(z)[source]
ActivationFunctions.clipped01lu(z)[source]

0 for x <= 0 x for 0 <= x <= 1 1 for 1 <= x

ActivationFunctions.clippedlu(z)[source]
-1 for x <= -1 x for -1 <= x <= 1 1 for 1 <= x
ActivationFunctions.elu(z)[source]
ActivationFunctions.identity(z)[source]
ActivationFunctions.softsign(z)[source]
ActivationFunctions.softsquare(z)[source]
ActivationFunctions.maxout(z)[source]
ActivationFunctions.softmax(z)[source]
ActivationFunctions.gauss(z)[source]
ActivationFunctions.cdf(z)[source]

Cumulative distribution function via erf (Error function)

ActivationFunctions.constant_one()[source]
ActivationFunctions.constant_zero()[source]
class ActivationFunctions.Round3(output_types_preference=None, name=None)[source]
c_code(node, name, x, z, sub)[source]

Required: return the C implementation of an Op.

Returns C code that does the computation associated to this Op, given names for the inputs and outputs.

Parameters:
node : Apply instance

The node for which we are compiling the current c_code.

The same Op may be used in more than one node.

name : str

A name that is automatically assigned and guaranteed to be unique.

inputs : list of strings

There is a string for each input of the function, and the string is the name of a C variable pointing to that input. The type of the variable depends on the declared type of the input. There is a corresponding python variable that can be accessed by prepending “py_” to the name in the list.

outputs : list of strings

Each string is the name of a C variable where the Op should store its output. The type depends on the declared type of the output. There is a corresponding python variable that can be accessed by prepending “py_” to the name in the list. In some cases the outputs will be preallocated and the value of the variable may be pre-filled. The value for an unallocated output is type-dependent.

sub : dict of strings

Extra symbols defined in CLinker sub symbols (such as ‘fail’). WRITEME

Raises:
MethodNotDefined

The subclass does not override this method.

grad(inputs, gout)[source]
ActivationFunctions.hard_sigmoid(x)[source]
ActivationFunctions.binary_tanh(x)[source]
ActivationFunctions.binary_sigmoid(x)[source]
ActivationFunctions.strtoact(act)[source]
Parameters:act (str | list[str]) – activation function name, or multiple such as a list or separated by “:”
Return type:theano.Op | list[theano.Op]
ActivationFunctions.strtoact_single_joined(act)[source]
Parameters:act (str | None) – activation function name, or multiple such as a list or separated by “:”
Return type:theano.Op