(self, h, x)
| 31 | self.convq = nn.Conv2d(hidden_dim+input_dim, hidden_dim, 3, padding=1) |
| 32 | |
| 33 | def forward(self, h, x): |
| 34 | hx = torch.cat([h, x], dim=1) |
| 35 | |
| 36 | z = torch.sigmoid(self.convz(hx)) |
| 37 | r = torch.sigmoid(self.convr(hx)) |
| 38 | q = torch.tanh(self.convq(torch.cat([r*h, x], dim=1))) |
| 39 | |
| 40 | h = (1-z) * h + z * q |
| 41 | return h |
| 42 | |
| 43 | class SepConvGRU(nn.Module): |
| 44 | def __init__(self, hidden_dim=128, input_dim=192+128): |
nothing calls this directly
no outgoing calls
no test coverage detected