[docs]classMish(nn.Module):"""Implements the Mish activation module from `"Mish: A Self Regularized Non-Monotonic Neural Activation Function" <https://arxiv.org/pdf/1908.08681.pdf>`_"""def__init__(self):super(Mish,self).__init__()defforward(self,input):returnF.mish(input)
[docs]classNLReLU(nn.Module):"""Implements the Natural-Logarithm ReLU activation module from `"Natural-Logarithm-Rectified Activation Function in Convolutional Neural Networks" <https://arxiv.org/pdf/1908.03682.pdf>`_ Args: inplace (bool): should the operation be performed inplace """__constants__=['inplace']def__init__(self,inplace=False):super(NLReLU,self).__init__()self.inplace=inplacedefforward(self,input):returnF.nl_relu(input,inplace=self.inplace)defextra_repr(self):inplace_str='inplace=True'ifself.inplaceelse''returninplace_str