Take a look at this in-betweening technique in a recent ‘two-minute paper’ video: https://youtu.be/mb6WJ34xQXg
After some training, there is quite some realistic in-between generated for virtual humans.
My point is there in no "formula" you can use, since it's not (just) about "smooth" motion in 2D specifically.
In 2D animation, also always do "breakdowns" between key poses and those are absolutely artistic decisions that cannot be automated (at least without doing a selection step—you could probably automate, e.g. generating 32 different variations and then allow the user to select the breakdown they like best—same with inbetweens, you could allow the user to select the style—but at that point it's only barely ML).
In 2D animation, also always do "breakdowns" between key poses and those are absolutely artistic decisions that cannot be automated (at least without doing a selection step—you could probably automate, e.g. generating 32 different variations and then allow the user to select the breakdown they like best—same with inbetweens, you could allow the user to select the style—but at that point it's only barely ML).
See https://youtu.be/86tqKH3zxuM for all of the different kinds of inbetweens
and https://youtu.be/wdPbiy-8BRo?t=108 for a demonstration of how important breakdowns are between key poses.
Source: I do 2D animation with computer inbetweens, and we also use ML to automate other aspects of our work.
Thanks for the link.