ivy.Container.static_softplus

ivy.Container.static_softplus(x, /, *, beta=None, threshold=None, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]

ivy.Container static method variant of ivy.softplus. This method simply wraps the function, and so the docstring for ivy.softplus also applies to this method with minimal changes.

Parameters
  • x (Union[Array Container]) – input container.

  • beta (Optional[Union[int, float]]) – The beta value for the softplus formation. Default: None. (default: None)

  • threshold (Optional[Union[int, float]]) – values above this revert to a linear function. Default: None. (default: None)

  • key_chains (Optional[Union[List[str], Dict[str, str]]]) – The key-chains to apply or not apply the method to. Default is None. (default: None)

  • to_apply (bool) – If True, the method will be applied to key_chains, otherwise key_chains (default: True) will be skipped. Default is True.

  • prune_unapplied (bool) – Whether to prune key_chains for which the function was not applied. (default: False) Default is False.

  • map_sequences (bool) – Whether to also map method to sequences (lists, tuples). Default is False. (default: False)

  • out (Optional[Container]) – optional output container, for writing the result to. It must have a shape (default: None) that the inputs broadcast to.

Return type

Container

Returns

ret – a container with the softplus unit function applied element-wise.

Examples

>>> x = ivy.Container(a=ivy.array([-0.3461, -0.6491]))
>>> y = ivy.Container.static_softplus(x)
>>> print(y)
{
    a: ivy.array([0.535, 0.42])
}
>>> x = ivy.Container(a=ivy.array([-1., 2., 4.]))
>>> y = ivy.Container.static_softplus(x, beta=0.5, threshold=2)
>>> print(y)
{
    a: ivy.array([0.948, 2.63, 4.25])
}
Device Support

Device

JAX

NumPy

TensorFlow

PyTorch

CPU

GPU


Supported Frameworks: