[docs]classMish(nn.Module):"""Implements the Mish activation module from 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 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