Ejemplo n.º 1
0
 def forward(self, input):
     '''
     Forward pass of the function.
     '''
     if torch.__version__ >= '1.9':
         return F.mish(input)
     else:
         return Func.mish(input)
Ejemplo n.º 2
0
    def forward(self, x):
        # make sure the input tensor is flattened
        x = x.view(x.shape[0], -1)

        # apply Mila activation function
        if (self.activation == MISH):
            x = Func.mish(self.fc1(x))

        x = F.relu(self.fc2(x))
        x = F.relu(self.fc3(x))
        x = F.log_softmax(self.fc4(x), dim=1)

        return x
Ejemplo n.º 3
0
Archivo: mish.py Proyecto: zlapp/Mish-1
 def forward(self, input):
     '''
     Forward pass of the function.
     '''
     return Func.mish(input)