MCPcopy Create free account
hub / github.com/MaureenZOU/TSAM / InceptionModule

Class InceptionModule

src/model/i3d.py:100–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99
100class InceptionModule(nn.Module):
101 def __init__(self, in_channels, out_channels, name):
102 super(InceptionModule, self).__init__()
103
104 self.b0 = Unit3D(in_channels=in_channels, output_channels=out_channels[0], kernel_shape=[1, 1, 1], padding=0,
105 name=name + '/Branch_0/Conv3d_0a_1x1')
106 self.b1a = Unit3D(in_channels=in_channels, output_channels=out_channels[1], kernel_shape=[1, 1, 1], padding=0,
107 name=name + '/Branch_1/Conv3d_0a_1x1')
108 self.b1b = Unit3D(in_channels=out_channels[1], output_channels=out_channels[2], kernel_shape=[3, 3, 3],
109 name=name + '/Branch_1/Conv3d_0b_3x3')
110 self.b2a = Unit3D(in_channels=in_channels, output_channels=out_channels[3], kernel_shape=[1, 1, 1], padding=0,
111 name=name + '/Branch_2/Conv3d_0a_1x1')
112 self.b2b = Unit3D(in_channels=out_channels[3], output_channels=out_channels[4], kernel_shape=[3, 3, 3],
113 name=name + '/Branch_2/Conv3d_0b_3x3')
114 self.b3a = MaxPool3dSamePadding(kernel_size=[3, 3, 3],
115 stride=(1, 1, 1), padding=0)
116 self.b3b = Unit3D(in_channels=in_channels, output_channels=out_channels[5], kernel_shape=[1, 1, 1], padding=0,
117 name=name + '/Branch_3/Conv3d_0b_1x1')
118 self.name = name
119
120 def forward(self, x):
121 b0 = self.b0(x)
122 b1 = self.b1b(self.b1a(x))
123 b2 = self.b2b(self.b2a(x))
124 b3 = self.b3b(self.b3a(x))
125 return torch.cat([b0, b1, b2, b3], dim=1)
126
127
128class InceptionI3d(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected