mindspore.nn.get_activation

mindspore.nn.get_activation(name, prim_name=None)[source]

Gets the activation function.

Parameters
  • name (str) – The name of the activation function.

  • prim_name (Union[str, None]) – The name of primitive. Default: None.

Returns

Function, the activation function.

Supported Platforms:

Ascend GPU CPU

Examples

>>> sigmoid = nn.get_activation('sigmoid')
>>> print(sigmoid)
Sigmoid<>