(self, n_in, n_out, activation="linear", temperature=1.0)
| 125 | |
| 126 | class AttBlock(nn.Module): |
| 127 | def __init__(self, n_in, n_out, activation="linear", temperature=1.0): |
| 128 | super(AttBlock, self).__init__() |
| 129 | |
| 130 | self.activation = activation |
| 131 | self.temperature = temperature |
| 132 | self.att = nn.Conv1d( |
| 133 | in_channels=n_in, |
| 134 | out_channels=n_out, |
| 135 | kernel_size=1, |
| 136 | stride=1, |
| 137 | padding=0, |
| 138 | bias=True, |
| 139 | ) |
| 140 | self.cla = nn.Conv1d( |
| 141 | in_channels=n_in, |
| 142 | out_channels=n_out, |
| 143 | kernel_size=1, |
| 144 | stride=1, |
| 145 | padding=0, |
| 146 | bias=True, |
| 147 | ) |
| 148 | |
| 149 | self.bn_att = nn.BatchNorm1d(n_out) |
| 150 | self.init_weights() |
| 151 | |
| 152 | def init_weights(self): |
| 153 | init_layer(self.att) |
nothing calls this directly
no test coverage detected