Hard-Mish

场景一: Hard-Mish

场景一: Hard-Mish

Hard-Mish_第1张图片
Hard-Mish_第2张图片

class Mish(nn.Module):
    @staticmethod
    def forward(x):
        # x*tanh( ln(1+e^x) )
        return x * F.softplus(x).tanh()

class Hard_Mish(nn.Module):
    @staticmethod
    def forward(x):
        return x *F.hardtanh( F.softplus(x))
        #return  x * F.softplus(x)   if  0

实验结果:

you did it
在这里插入图片描述

你可能感兴趣的:(深度学习,tensorflow)