Simone Scardapane Profile picture
Sep 20 β€’ 17 tweets β€’ 8 min read
Gather round, Twitter folks, it's time for our beloved
**Alice's adventures in a differentiable wonderland**, our magical tour of autodiff and backpropagation. πŸ”₯

Slides below 1/n πŸ‘‡ Image
It all started from her belief that "very few things indeed were really impossible". Could AI truly be below the corner? Could differentiability be the only ingredient that was needed?

2/n Image
Wondering were to start, Alice discovered a paper by pioneer @ylecun promising "a path towards autonomous intelligent agents".

Intelligence would arise, it was argued, by several interacting modules, were everything was assumed to be *differentiable*.

3/n Image
Alice reasoned that differentiability was, indeed, the only thing that could make sense of the explosion of deep learning architectures, from Transformers to neural computers and implicit layers.

4/n Image
It was time, then, to learn a bit about differentiability and gradient descent. This made sense, as the Cat told her that "if you don't care where you are going, it does not matter which way you go".

5/n Image
Alice fell through the looking glass in a strange world made of gradient, Jacobians, VJPs, and other mythical creatures. It was not so hard as it appeared at the beginning, though.

6/n Image
She learned about function composition, automatic differentiation, and the difference between forward-mode (left-to-right) and reverse-mode (right-to-left) differentiation.

7/n Image
"But wait!", the Dodo told her. "The best way to explain is to do it."

So Alice set out to build her own autodiff system.

8/n Image
She first started by learning more about the anatomy of a deep learning framework: primitives, JVPs, dispatchers and schedulers.

9/n Image
Time to start building! Luckily, she had help from a number of scientists who guided her along the way: @mblondel_ml @SingularMattrix (autodidact) @karpathy (micrograd) @realGeorgeHotz (tinygrad).

10/n Image
The core of an autodiff system turned out to be easier than expected, and she ended up re-implementing a simple PyTorch-like API.

Not fully working, but enough to get a glimpse of its functioning. At that moment, she felt like she was getting the hang of this wonderland.

11/n Image
Alice also learned about object-oriented vs. functional frameworks, and thanks to @sjmielke and her tutorials, she learned how to purify one code to move from one side to the other.

12/n Image
"Curioser and curioser!" cried Alice, as she moved to more advanced topics while simultaneously loosing her grasp on English.

13/n Image
You can also differentiate through an implicitly defined layer! She wondered in puzzlement while exploring the tutorial of @zicokolter, @DavidDuvenaud, @SingularMattrix and understanding that this was, indeed, a stranger land than anything she expected.

14/n Image
Exhausted, she finally got home. Did she learned anything useful? Was she indeed closer to AI? β€œTut, tut, child!” said the Duchess. β€œEverything’s got a moral, if only you can find it.”

Maybe even these slides.

Slides are here: docs.google.com/presentation/d… Image
@alfcnz I am sure you will appreciate the absurd amount of time I devoted to these slides. 😎
@mmbronstein @PetarV_93 Now I wanted to make Alice's adventures in a geometric wonderland, but I exhausted my creativity. πŸ₯²

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Simone Scardapane

Simone Scardapane Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @s_scardapane

Mar 10
*Generative Flow Networks*

A new method to sample structured objects (eg, graphs, sets) with a formulation inspired to the state space of reinforcement learning.

I have collected a few key ideas and pointers below if you are interested. πŸ‘€

1/n

πŸ‘‡ Image
*Flow Network based Generative Models for Non-Iterative Diverse Candidate Generation*
#NeurIPS paper by @folinoid @JainMoksh et al. introducing the method.

The task is learning to sample objects that can be built 1 piece at a time ("lego-style").

2/n

arxiv.org/abs/2106.04399 Image
For example: a complex molecule can be built by adding one atom at a time; an image by colouring one pixel per iteration; etc.

If you formalize this process, you get a state space where you move from an "empty" object to a complete object by traversing a graph.

3/n Image
Read 13 tweets
Dec 28, 2021
*Neural networks for data science* lecture 8 is out!

And it's already the last lecture! πŸ™€

What lies beyond classical supervised learning? It turns out, _way_ too many subfields!

/n
Here is my overview of everything that can happen when we have > 1 "task": fine-tuning, pre-training, meta learning, continual learning...

The slides have my personal selection of material. 😎

/n
The slides are here: sscardapane.it/assets/files/n…

All the material, as always, is here: sscardapane.it/teaching/nnds-…

/n
Read 4 tweets
Nov 3, 2021
*Neural networks for data science* lecture 4 is out! πŸ‘‡

aka "here I am talking about convolutional neural networks while everyone asks me about transformers"

/n
CNNs are a great way to show how considerations about the data can guide the design of the model.

For example, only assuming locality (and not transl. invariance) we get locally-connected networks.

/n
Everything else is a pretty standard derivation of CNN ideas (stride, global pooling, receptive field, ...).

/n
Read 7 tweets
Aug 2, 2021
*Reproducible deep learning*: Time for exams!

To a practical course, a practical exam: I asked each student to include a new branch in the repository showcasing additional tools and libraries.

The result? *Everyone* loves some hyper-parameter optimization. πŸ˜„

/n
Thanks to their work, you'll find practical examples of fine-tuning parameters using @OptunaAutoML, AX (from @facebookai), @raydistributed Tune, and Auto-PyTorch and Talos coming soon.

So many ideas for next year! πŸ˜›

github.com/sscardapane/re…

/n
You will also find additional exercises on:

- Serving the model with TorchServe;
- Managing experiments with @DVCorg 2.0;
- Set up cron jobs for re-training.

BTW, if you'd like to add something, feel free to contact me or open a pull request. πŸ™‚

github.com/sscardapane/re…

/n
Read 4 tweets
Jun 16, 2021
*Score-based diffusion models*

An emerging approach in generative modelling that is gathering more and more attention.

If you are interested, I collected some introductive material and thoughts in a small thread. πŸ‘‡

Feel free to weigh in with additional material!

/n
An amazing property of diffusion models is simplicity.

You define a probabilistic chain that gradually "noise" the input image until only white noise remains.

Then, generation is done by learning to reverse this chain. In many cases, the two directions have similar form.

/n
The starting point for diffusion models is probably "Deep Unsupervised Learning using Nonequilibrium Thermodynamics" by @jaschasd Weiss @niru_m @SuryaGanguli

Classic paper, definitely worth reading: arxiv.org/abs/1503.03585

/n
Read 13 tweets
Jun 14, 2021
*LocoProp: Enhancing BackProp via Local Loss Optimization*
by @esiamid @_arohan_ & Warmuth

Interesting approach to bridge the gap between first-order, second-order, and "local" optimization approaches. πŸ‘‡

/n Image
The key idea is to use a single GD step to define auxiliary local targets for each layer, either at the level of pre- or post-activations.

Then, optimization is done by solving local "matching" problems wrt these new variables.

/n Image
What is intriguing is that the framework interpolates between multiple scenarios: first solution step is the original GD, while closed-form solution (in one case) is similar to a pre-conditioned GD model. Optimization is "local" in the sense that it decouples across layers.

/n Image
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(