Designing Stable Neural Networks using Convex Analysis and ODEs