mindspore.nn.get_activation

View Source On Gitee
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

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