MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / FactorizedReduce

Class FactorizedReduce

AutoML/darts-master/cnn/operations.py:90–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89
90class FactorizedReduce(nn.Module):
91
92 def __init__(self, C_in, C_out, affine=True):
93 super(FactorizedReduce, self).__init__()
94 assert C_out % 2 == 0
95 self.relu = nn.ReLU(inplace=False)
96 self.conv_1 = nn.Conv2d(C_in, C_out // 2, 1, stride=2, padding=0, bias=False)
97 self.conv_2 = nn.Conv2d(C_in, C_out // 2, 1, stride=2, padding=0, bias=False)
98 self.bn = nn.BatchNorm2d(C_out, affine=affine)
99
100 def forward(self, x):
101 x = self.relu(x)
102 out = torch.cat([self.conv_1(x), self.conv_2(x[:,:,1:,1:])], dim=1)
103 out = self.bn(out)
104 return out
105

Callers 3

operations.pyFile · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected