(self, x)
return x
input: (samples_num, freq_bins, time_steps, 1)
input: (samples_num, freq_bins, time_steps, 1)
input : ( samples_num freq_bins time_steps 1 )
def forward(self, x):
        """input: (samples_num, freq_bins, time_steps, 1)
        """

        att = self.att(x)
        att = self.activate(att, self.att_activation)

        cla = self.cla(x)
        cla = self.activate(cla, self.cla_activation)

        att = att[:, :, :, 0]   # (samples_num, classes_num, time_steps)
        cla = cla[:, :, :, 0]   # (samples_num, classes_num, time_steps)

        epsilon = 1e-7
        att = torch.clamp(att, epsilon, 1. - epsilon)

        norm_att = att / torch.sum(att, dim=2)[:, :, None]
        x = torch.sum(norm_att * cla, dim=2)

        return x
def forward ( self , x ) : att = self . att ( x ) att = self . activate ( att , self . att_activation ) cla = self . cla ( x ) cla = self . activate ( cla , self . cla_activation ) att = att [ : , : , : , 0 ] # (samples_num, classes_num, time_steps) cla = cla [ : , : , : , 0 ] # (samples_num, classes_num, time_steps) epsilon = 1e-7 att = torch . clamp ( att , epsilon , 1. - epsilon ) norm_att = att / torch . sum ( att , dim = 2 ) [ : , : , None ] x = torch . sum ( norm_att * cla , dim = 2 ) return x