Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BasicSepConv 这里面的卷积是深度可分离卷积吗? #135

Open
getr1ch opened this issue Apr 25, 2021 · 0 comments
Open

BasicSepConv 这里面的卷积是深度可分离卷积吗? #135

getr1ch opened this issue Apr 25, 2021 · 0 comments

Comments

@getr1ch
Copy link

getr1ch commented Apr 25, 2021

class BasicSepConv(nn.Module):

def __init__(self, in_planes, kernel_size, stride=1, padding=0, dilation=1, groups=1, relu=True, bn=True, bias=False):
    super(BasicSepConv, self).__init__()
    self.out_channels = in_planes
    self.conv = nn.Conv2d(in_planes, in_planes, kernel_size=kernel_size, stride=stride, padding=padding, dilation=dilation, groups = in_planes, bias=bias) #这是深度可分离卷积吗 用keras 的depthwise代替可以吗?
    self.bn = nn.BatchNorm2d(in_planes,eps=1e-5, momentum=0.01, affine=True) if bn else None
    self.relu = nn.ReLU(inplace=True) if relu else None

def forward(self, x):
    x = self.conv(x)
    if self.bn is not None:
        x = self.bn(x)
    if self.relu is not None:
        x = self.relu(x)
    return x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant