(self, x, t)
| 390 | self.odefunc.adj = adj |
| 391 | |
| 392 | def forward(self, x, t): |
| 393 | self.integration_time = torch.tensor([0, t]).float().type_as(x) |
| 394 | |
| 395 | if self.adjoint: |
| 396 | out = torchdiffeq.odeint_adjoint(self.odefunc, x, self.integration_time, rtol=self.rtol, atol=self.atol, |
| 397 | method=self.method, options=dict(step_size=self.step_size, perturb=self.perturb)) |
| 398 | else: |
| 399 | out = torchdiffeq.odeint(self.odefunc, x, self.integration_time, rtol=self.rtol, atol=self.atol, |
| 400 | method=self.method, options=dict(step_size=self.step_size, |
| 401 | perturb=self.perturb)) |
| 402 | |
| 403 | outs = self.odefunc.out |
| 404 | self.odefunc.out = [] |
| 405 | outs.append(out[-1]) |
| 406 | h_out = torch.cat(outs, dim=1) |
| 407 | h_out = self.mlp(h_out) |
| 408 | |
| 409 | return h_out |
| 410 | |
| 411 | |
| 412 | class CGP(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected