MCPcopy Create free account
hub / github.com/dangf15/THLNet / forward

Method forward

utils.py:103–108  ·  view source on GitHub ↗
(self, inpt)

Source from the content-addressed store, hash-verified

101 self.bias = Variable(torch.zeros(1, num_features, 1, 1), requires_grad=False)
102
103 def forward(self, inpt):
104 # inpt: (B,C,T,F)
105 ins_mean = torch.mean(inpt, dim=[1,3], keepdim=True) # (B,C,T,1)
106 ins_std = (torch.std(inpt, dim=[1,3], keepdim=True) + self.eps).pow(0.5) # (B,C,T,1)
107 x = (inpt - ins_mean) / ins_std
108 return x * self.gain.expand_as(x).type(x.type()) + self.bias.expand_as(x).type(x.type())
109
110
111

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected