#TheLongRoadToLearnSomethingNew
I decided it is high time I learn something about machine learning. I couldn't care less about learning how to use Tensorflow or any other package that do machine learning for you. I "just" want a Physicist's intuition for how and why it works.
1/
A million years ago I asked here for advices on resources. Some were very good advices, some were not. But I am mow armed with a textbook, and will irregularly update here on my progresses.
2/
I am not very far on my path. I've read a few online resources and (so far) the first 30 pages of this book.
I am aware machine learning is a HUGE topic, so I will begin by concentrating on neural networks (and probably a sub-sub-class of neural networks).
3/ Image
Let's start as simple as it gets: we want "something" that given an input give us a output. E.g. input a picture and output the same picture with all cats highlighted.
The simplest possible object that connects pictures to pictures is matrix, so we start there.
4/
(If you are used to having matrices eat vectors and spit vectors, and this confuses you, just take all the pixels in the pictures, put them in a row and call that a vector. It works.)
5/
I am going to worry later about the (many) limitations of this approach. For now I will worry about how to make this work. Highlighting cats is too difficult for me at this level, so I will start with a much simpler problem: input a noisy image and output a less noisy one.
6/
To be honest, even this is too hard, so I will do it for just two (small) images. Now the problem is how to find the matrix entries that are able to perform this "simple" task. For this particular case there are smarter approaches, but we want to build toward ML.
7/
So what we will do is to start with some bad guess (a matrix filled with 1s), multiply it by a noisy image, calculate how far away from the correct answer (which we know) it is, modify slightly one of the matrix entries, and if it reduces the error, keep the modification.
8/
This is a very rough way to perform "gradient descent", i.e. to numerically find the set of parameters that minimize a certain metric.
9/
Gradient descent is a very active field of research, with a lot of very smart techniques available, but we will worry about them in the future. Right now I really want to keep things small and stupid. There will be time to make everything more efficient and elegant.
10/
So does this work? More or less yes. It takes some time to train (longer than the video below), but you can find a matrix that is quite good at giving you something close to the desired image even when the input is very noisy.
11/

• • •

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

Keep Current with Jacopo Bertolotti

Jacopo Bertolotti 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 @j_bertolotti

31 Dec 21
#PhysicsFactlet The ones I am most proud of from 2021 (in chronological order)
A visualization of what an eigenvector is (at least for 2x2 matrices)
Pulse chirping (keeping the pulse duration constant for ease of visualization, although in reality one usually keeps the bandwidth constant)
Read 8 tweets
10 Dec 21
#PhysicsFactlet (308)
There are not many problems in Physics that can be solved exactly, so we tend to rely on perturbation theory a lot. One of the problems with perturbation theory is that infinities have the bad habit of popping up everywhere when you use it.
(A thread 1/ )
If you know anything about Physics you are probably thinking about quantum field theory and all the nasty infinities that we need to "renormalize". But quantum field theory is difficult, so let's look at a MUCH simpler problem: the anharmonic oscillator.
2/
Disclaimer: I can't know how much you (the reader) know about this. For some of you this thread will be full of obvious stuff. For others there will be so many missing steps to be hard to follow. I will do my best, but I apologize with everyone in advance.
3/
Read 24 tweets
23 Nov 21
In celebration of 10k followers, here is a new edition of "people you should follow, but that (given their follower count) probably you don't".
i.e. people I follow, with <5k followers, non-locked, active, that in my personal opinion you should follow too.
1/
In random order:
@LCademartiriLab food, chemistry, architecture, and beauty in general. Trigger warning: strong opinions.
@VKValev bit of history of Physics + chiral media
@DrBrianPatton social justice in science
@alisonmartin57 weaving and bamboo structures
2/
@VergaraLautaro history of Physics
@PKoppenburg LHCb
@OptoLia optics, entrepreneurship.
@BrunoLevy01 fluid simulations
@lisyarus physics-based graphics coding
@RobJLow mathematics and education
@bruko Photography (and overall great human being)
3/
Read 8 tweets
28 Oct 21
#PhysicsFactlet (299)
Fractional derivatives: a brief tutorial/🧵. If you know some calculus you should be able to follow. If you are a Mathematician (or you like to see things done properly) I advise "Fractional Differential Equations" by I. Podlubny instead 😉
1/
The history of fractional derivatives begins together with the history of the much more common integer-order derivatives, and a number of big names in mathematics worked on it over the centuries.
Afaik, the first to work on the problem was Leibniz himself.
2/
Since differentiating twice a function yields the second derivative, the Marquis de l'Hôpital immediately wondered whether it makes sense to think about an operator which, if applied twice, gave the first derivative, i.e. some sort of derivative of order 0.5
3/
Read 23 tweets
23 Jun 21
#PhysicsFactlet (283)
Lorentz transformations pre-date Special Relativity. How is that even possible?
A thread.

Trigger warning for typos (hopefully just in the text and not in the equations) and carefree manipulations of equations 😉
1/
The historical route is interesting but complicated, so I will leave that story for someone more qualified to write it. What I want to look at is: how do we get the Lorentz transformations without knowing anything about special relativity?
2/
A requirement we want all physical theories to satisfy is the "principle of relativity", i.e. the fact that the laws of Physics are the same in every frame of reference. Were this not the case, each of us would experience a different universe, making life quite complicated.
3/
Read 24 tweets
26 Apr 21
#PhysicsFactlet (273)
A brief introduction to the calculus of variations.
Trigger warning: lots of formulas manipulated the way experimental physicists do 🙂
🧵 1/
The simplest introduction to the calculus of variations is to solve in a slightly roundabout way a very easy geometrical problem: what is the shortest path between 2 points on a plane?
(spoiler: it's a straight line)
2/
Let's pretend we have no idea, and so we are forced to take into consideration all possible functions passing through 2 given points. What we want to do is to calculate the length of each of them, and select the shortest one.
(spoiler: we are not REALLY going to do that)
3/
Read 20 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

Too expensive? 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!

:(