Public API: torchdyn package

Adjoint

class torchdyn.Adjoint(intloss=None)[source]

Bases: torch.nn.modules.module.Module

Adjoint class template.

Parameters:intloss (nn.Module) – nn.Module specifying the integral loss term
adjoint_dynamics(s, adjoint_state)[source]

Define the vector field of the augmented adjoint dynamics to be then integrated backward. An Adjoint object is istantiated into the NeuralDE if the adjoint method for back-propagation was selected.

Parameters:
  • s (float) – current depth
  • adjoint_state (tuple of tensors) – tuple of four tensors constituting the augmented adjoint state to be integrated: h (hidden state of the neural ODE), λ (Lagrange multiplier), μ (loss gradient state), s_adj (adjoint state of the integration depth)
forward(func, h0, s_span, rtol=0.0001, atol=0.0001, method='dopri5', options={})[source]

Learner

Plotting Functions

This API is experimental and might be subjected to substantial changes. It will be made available in the next release.