LogSigmoid

Contents

LogSigmoid#

class brainstate.nn.LogSigmoid(name=None)#

Applies the element-wise function.

\[\text{LogSigmoid}(x) = \log\left(\frac{ 1 }{ 1 + \exp(-x)}\right)\]

Shape#

  • Input: \((*)\), where \(*\) means any number of dimensions.

  • Output: \((*)\), same shape as the input.

Examples

>>> import brainstate.nn as nn
>>> import brainstate
>>> m = nn.LogSigmoid()
>>> x = brainstate.random.randn(2)
>>> output = m(x)