logsigmoid#

ivy.logsigmoid(input, /, *, complex_mode='jax', out=None)[source]#

Apply element-wise Log-sigmoid of x.

logsigmoid(x) = log(1 / (1 + exp(-x)).

Parameters:
  • input (Union[NativeArray, Array]) – Input array.

  • complex_mode (Literal['split', 'magnitude', 'jax'], default: 'jax') – optional specifier for how to handle complex data types. See ivy.func_wrapper.handle_complex_input for more detail.

Return type:

Array

Returns:

Array with same shape as input with Log-sigmoid applied to every element.

Examples

With ivy.Array input:

>>> x = ivy.array([-1., 0., 1.])
>>> z = x.logsigmoid()
>>> print(z)
ivy.array([-1.31326175, -0.69314718, -0.31326169])
>>> x = ivy.array([1.5, 0.7, -2.4])
>>> z = x.logsigmoid()
>>> print(z)
ivy.array([-0.20141329, -0.40318608, -2.48683619])

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([1.0, -1.2]), b=ivy.array([0.2, 0.6]))
>>> x = ivy.logsigmoid(x)
>>> print(x)
{
    a: ivy.array([-0.31326169, -1.46328247]),
    b: ivy.array([-0.59813893, -0.43748799])
}
Array.logsigmoid(self, complex_mode='jax')[source]#

ivy.Array instance method variant of ivy.logsigmoid. This method simply wraps the function, and so the docstring for ivy.logsigmoid also applies to this method with minimal changes.

Parameters:
  • self (Array) – Input array.

  • complex_mode (Literal['split', 'magnitude', 'jax'], default: 'jax') – optional specifier for how to handle complex data types. See ivy.func_wrapper.handle_complex_input for more detail.

Return type:

Array

Returns:

Array with same shape as input with Log-sigmoid applied to every element.

Examples

>>> x = ivy.array([-1., 2., 4., -10.])
>>> z = x.logsigmoid()
>>> print(z)
ivy.array([ -1.31326175,  -0.126928  ,  -0.01814993, -10.00004578])
>>> x = ivy.array([-2.5, 1., 0, 4.5])
>>> z = x.logsigmoid()
>>> print(z)
ivy.array([-2.57888985, -0.31326169, -0.69314718, -0.01104775])
Container.logsigmoid(self, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, complex_mode='jax')[source]#

Apply element-wise Log-sigmoid of x i.e. log(1 / (1 + exp(-x)).

Parameters:
  • self (Container) – Input container.

  • complex_mode (Literal['split', 'magnitude', 'jax'], default: 'jax') – optional specifier for how to handle complex data types. See ivy.func_wrapper.handle_complex_input for more detail.

Return type:

Container

Returns:

ret – Container with Log-sigmoid applied to the leaves.

Examples

>>> x = ivy.Container(a=ivy.array([1.0, -1.2]), b=ivy.array([0.4, -0.2]))
>>> y = x.logsigmoid()
>>> print(y)
{
    a: ivy.array([-0.31326163, -1.46328258]),
    b: ivy.array([-0.51301527, -0.79813886])
}