MCPcopy Create free account
hub / github.com/ChinaYi/ASFormer / __init__

Method __init__

model.py:252–261  ·  view source on GitHub ↗
(self, num_layers, r1, r2, num_f_maps, input_dim, num_classes, channel_masking_rate, att_type, alpha)

Source from the content-addressed store, hash-verified

250
251class Encoder(nn.Module):
252 def __init__(self, num_layers, r1, r2, num_f_maps, input_dim, num_classes, channel_masking_rate, att_type, alpha):
253 super(Encoder, self).__init__()
254 self.conv_1x1 = nn.Conv1d(input_dim, num_f_maps, 1) # fc layer
255 self.layers = nn.ModuleList(
256 [AttModule(2 ** i, num_f_maps, num_f_maps, r1, r2, att_type, 'encoder', alpha) for i in # 2**i
257 range(num_layers)])
258
259 self.conv_out = nn.Conv1d(num_f_maps, num_classes, 1)
260 self.dropout = nn.Dropout2d(p=channel_masking_rate)
261 self.channel_masking_rate = channel_masking_rate
262
263 def forward(self, x, mask):
264 '''

Callers 9

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 1

AttModuleClass · 0.85

Tested by

no test coverage detected