Should not the key_conv, query_conv and value_conv be defined with group parameters? I am not clear what group parameters do in the following lines.
|
k_out = k_out.contiguous().view(batch, self.groups, self.out_channels // self.groups, height, width, -1) |
|
v_out = v_out.contiguous().view(batch, self.groups, self.out_channels // self.groups, height, width, -1) |
|
|
|
q_out = q_out.view(batch, self.groups, self.out_channels // self.groups, height, width, 1) |
|
|
|
out = q_out * k_out |
|
out = F.softmax(out, dim=-1) |
|
out = torch.einsum('bnchwk,bnchwk -> bnchw', out, v_out).view(batch, -1, height, width) |
Should not the key_conv, query_conv and value_conv be defined with group parameters? I am not clear what group parameters do in the following lines.
Stand-Alone-Self-Attention/attention.py
Lines 43 to 50 in a983f0f