Read this before diving into neural networks

I’ve had a hard time figuring out what exactly the neural networks actually do.
We were told by Andrew that this is some kind of an automatic feature engineering. And since then I was wondering how exactly each layer figures out its new features.

Let’s say we have the initial features x1, x2, x3.
I used to think that what the neural network do is to come up with more sophisticated features - x1 * x2 * x3, x1^2 and so on. It turned out that this is not actually the case

The case is that each layer is just a transformation of space.

If you are not aware of transformations you should definitely watch 3blue1brown’s series - https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab

So we are kind of squishing space with each layer, trying to get the data in a comfortable format that we can finally draw a line upon and have it separated. As in the case below:


Now there are cases that your neural network is badly designed and the transformations you are applying are not appropriate. Example:


It is beautiful how we can generalize such a complex model, don’t you think?

this article cleared the things for me - Neural Networks, Manifolds, and Topology -- colah's blog

14 Likes

This is a nice way of putting it.

Thanks for sharing!

Amazing article! Thanks! But I have a question: does making such topological transformations of the original dataset are actually equivalent to find sophisticated features like the combinations of x^n that you mentioned?

1 Like

Hi @Levent,

Please do play with the course 2 week 2 lab for “ReLU activation”, because there you will find how we can use ReLU to approxmiate a curve with a linear piecewise function.

Cheers!
Raymond

3 Likes

Wow ! This is just awesome !
Also were you able to find any visualizations (like the ones in your link) which shows how a sigmoid function transforms the input space?

This is just awesome ! Thanks for sharing.

I do not get the connection between the question and the answer you give. Can you be more explicit?

Hello @popaqy,

Why don’t we show a screenshot of the ReLU lab:

Screenshot from 2022-07-22 20-17-45

The neural network in the lab takes in one feature x, and with 3 neurons in the first layer, as shown on the left, it’s approximating a x^2 feature in a limited range of x with 3 linear piecewise equations.

Raymond

1 Like

Not exactly. Check out eigenvectors and linear operators for more understanding on the topic

Great visualization, thanks!

Thank you so much for sharing this! @popaqy !