motivation / intuition

Learning is easier than learning
Instead of learning the mapping , we only learn the small difference / “residual”.

To the extreme, if an identity mapping were optimal, it would be easier to push the residual to zero than to fit an identity mapping by a stack of nonlinear layers.

  • Most of the time, the input will be close to the output (think resolution upscaling task).
  • The network does not need to worry about memorizing the input.
  • vanishing gradients are prevented

center

Classic resnet block, size is preserved:
center
Increasing the stride (and proportionally also the conv channels) reduces the spatial dim and is often done in classification.

Resnet is a discrete, less general case of NODEs, it is an euler integrator, but there are much better ones:

overview and intuition

A ResNet can be thought of as a discrete-time analogs to an ODE:

You update the representation in discrete steps layer by layer. Neural ODE views this as an infinite process with continous time.
center
The regular NN has a discrete gradient field, whereas the gradient field of the ODE Network is continous. The black dots are data points.

Again, with resnet you only model the distance (residual) of

… this is a textbook euler numerical integrator (However euler integration, esp. with large time steps is a bad numerical integration method). So the resnet is doing euler integration over a vector field , so what the neural network is learning, , can also be thought of as a vector field, a differential equation

With NODE, we model the differential equation itself, instead of just a one-timestep-update or flow-map of the differential equation.

So it is a generalization of resnets to continuous time, where you also use a fancier integrator and smallar or arbitrary time-steps to model the vector field very accurately.
The mathematician’s solution to this would be:

That’s hard to compute, hence we approximate it (and you can use any integrator for that).


Classic dynamical system:

With NODE, is parametrized by a neural network

Free parameters:
network parameters
initial condition
timestep

Hidden state:
… data is samples at discrete points in time (doesn’t need to be uniformly in time), so between any two data / measurement points, there is a continous state and the flow map integrates along that hidden state from to .
And we want information about this hidden state, which is not in the training data!

TODO

steve skips over the details here “lagrange multiplier, adjoint equation”, “we been knowing how to do this the past 20 years”, … TODO steve’s optimization bootcamp)

tldr: we can keep track of the variable which keeps track of with AD, in the paper called reverse-mode differentiation

561|center

Link to original

References

Official pytorch code
Residual Connection | PapersWithCode