MCPcopy Create free account
hub / github.com/TrustAGI-Lab/MTGODE / forward

Method forward

layer.py:392–409  ·  view source on GitHub ↗
(self, x, t)

Source from the content-addressed store, hash-verified

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
412class CGP(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected