11年it研发经验,从一个会计转行为算法工程师,学过C#,c++,java,android,php,go,js,python,CNN神经网络,四千多篇博文,三千多篇原创,只为与你分享,共同成长,一起进步,关注我,给你分享更多干货知识!
# coding:utf-8
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
class conv_bn_relu6(nn.Module):
def __init__(self, nin, nout, kernel_size, stride, padding, bias=False):
super(conv_bn_relu6, self).__init__()
self.conv = nn.Conv2d(nin, nout, kernel_size=kernel_size, stride=stride, padding=padding, bias=bias)
self.batch_norm = nn.BatchNorm2d(nout)
self.relu = nn.ReLU6(True)
# self.relu = mish.Mish()
def forward(self, x):
out = self.conv(x)
out = self.batch_norm(out)
out = self.relu(out)
return