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

Class cPReLU

complexnn.py:12–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10 pass
11
12class cPReLU(nn.Module):
13
14 def __init__(self, complex_axis=1):
15 super(cPReLU,self).__init__()
16 self.r_prelu = nn.PReLU()
17 self.i_prelu = nn.PReLU()
18 self.complex_axis = complex_axis
19
20
21 def forward(self, inputs):
22 real, imag = torch.chunk(inputs, 2,self.complex_axis)
23 real = self.r_prelu(real)
24 imag = self.i_prelu(imag)
25 return torch.cat([real,imag],self.complex_axis)
26
27class NavieComplexLSTM(nn.Module):
28 def __init__(self, input_size, hidden_size, projection_dim=None, bidirectional=False, batch_first=False):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected