ML Katas

Building a Neural Ordinary Differential Equation (NODE) Layer

hard (>1 hr) node ode continuous differential equation
this month by E

Implement a simple Neural Ordinary Differential Equation (NODE) layer. This involves defining a torch.nn.Module that represents the derivative function f(t,z(t)) and then using torchdiffeq.odeint to solve the ODE. The hidden state of the network is the solution to this ODE. This is a non-standard but powerful approach for continuous-time modeling.

dz/dt=f(z,t,θ)

Verification: Run a forward pass through your NODE layer. The output shape should be correct. You should see that backpropagation works as expected, as torchdiffeq handles the adjoint method for gradient calculation.