class_docstr: Swish activation function as a link.
  
  Args:
      beta_shape (tuple of ints or None): Shape of the parameter variable
          :math:`\beta`. If ``None``, parameter initialization will be
          deferred until the first forward data pass at which time the shape
          will be determined.
      beta_init (float): Initial value of the parameter variable
          :math:`\beta`.
  
  See the paper for details: `Searching for Activation Functions
  <https://arxiv.org/abs/1710.05941>`_
  
  To try Swish instead of ReLU, replace ``F.relu`` with individual ``Swish``
  links registered to the model. For example, the model defined in the
  `MNIST example
  <https://github.com/chainer/chainer/tree/master/examples/mnist/train_mnist.py>`_
  can be rewritten as follows.
  
  ReLU version (original)::
  
      class MLP(chainer.Chain):
  
          def __init__(self, n_units, n_out):
              super(MLP, self).__init__()
              with self.init_scope():
                  self.l1 = L.Linear(None, n_units)
                  self.l2 = L.Linear(None, n_units)
                  self.l3 = L.Linear(None, n_out)
  
          def forward(self, x):
              h1 = F.relu(self.l1(x))
              h2 = F.relu(self.l2(h1))
              return self.l3(h2)
  
  Swish version::
  
      class MLP(chainer.Chain):
  
          def __init__(self, n_units, n_out):
              super(MLP, self).__init__()
              with self.init_scope():
                  self.l1 = L.Linear(None, n_units)
                  self.s1 = L.Swish(None)
                  self.l2 = L.Linear(None, n_units)
                  self.s2 = L.Swish(None)
                  self.l3 = L.Linear(None, n_out)
  
          def forward(self, x):
              h1 = self.s1(self.l1(x))
              h2 = self.s2(self.l2(h1))
              return self.l3(h2)
  
  .. seealso::
      See :func:`chainer.functions.swish` for the definition of Swish
      activation function.
  
  Attributes:
      beta (~chainer.Parameter): Parameter variable :math:`\beta`.
docstr: Applies the Swish activation function.
  
  Args:
      x (~chainer.Variable): Input variable.
  
  Returns:
      ~chainer.Variable: Output of the Swish activation function.
docstr_tok: ["Applies","the","Swish","activation","function",".","Args",":","x","(","~chainer.Variable",")",":","Input","variable",".","Returns",":","~chainer.Variable",":","Output","of","the","Swish","activation","function","."]
code: def forward(self, x):
      """Applies the Swish activation function.
  
      Args:
          x (~chainer.Variable): Input variable.
  
      Returns:
          ~chainer.Variable: Output of the Swish activation function.
  
      """
      if self.beta.array is None:
          self.beta.initialize(x.shape[1:])
  
      return swish.swish(x, self.beta)
  
file_path: chainer/chainer/links/activation/swish.py
imports: from chainer.functions.activation import swish
  from chainer import initializers
  from chainer import link
  from chainer import variable
label_desc: Use image node_id 2 for calling the Swish obj's underlying member method code with example usage: obj.forward(x) and returns: swish