|
1 | 1 | --- |
2 | | -title: Explaining Neural Networkds |
| 2 | +title: Explaining Neural Networks |
3 | 3 | tags: [machine learning, divulgation] |
4 | 4 | style: fill |
5 | 5 | color: info |
6 | | -description: Revisiting the Discrete Cosine Transform to denoise images |
| 6 | +description: Metaphorically Explaining Neural Networks |
7 | 7 | --- |
8 | 8 |
|
9 | | -Richard Feynmann tenía una manera muy sencilla de explicar cómo hacía él para explicar conceptos complejos a personas que desconocían del tema, o a cualquier persona en general. Lo típico que se suele decir es que si no sabes explicárselo a una persona muy mayor (a mucha gente le gusta poner el ejemplo de su abuela), no lo entiendes. Esto deriva de la cita de Albert Einstein: "I you can’t explain it simply, then you don’t understand it well enough". A mi no me gusta este punto de vista; me parece incompleto. Feyman nos dice, por su parte, que su (muy útil) receta de la fortuna a seguir es: |
| 9 | + |
10 | 10 |
|
11 | | -Explica (literalmente) el concepto a un niño pequeño pero inteligente: Imagina que estás explicando el tema a un niño de 8 años, como tu primo. Usa un lenguaje sencillo, analogías y ejemplos que faciliten la comprensión. El objetivo es simplificar tanto como sea posible. |
| 11 | +Richard Feynman had a very simple way of explaining how he would explain complex concepts to people who had no knowledge about the topic, or to anyone in general. The typical thing that is said is that if you can’t explain it to an elderly person (many people like to use the example of their grandmother), you don’t understand it. This comes from the quote by Albert Einstein: "If you can't explain it simply, then you don’t understand it well enough." I don’t like this point of view; it seems incomplete to me. Feynman, for his part, tells us that his (very useful) recipe for success is as follows: |
12 | 12 |
|
13 | | -Medita sobre lo que has explicado: Después de dar esa explicación, toma un tiempo para reflexionar sobre lo que dijiste. Pregúntate si realmente entiendes cada parte del concepto. Este espacio de reflexión te permite ver el problema desde una perspectiva diferente, ya que te das cuenta de las posibles lagunas en tu conocimiento, al comparar lo que creías que entendías con lo que realmente puedes explicar. |
| 13 | +1. **Explain (literally) the concept to a small but smart child**: Imagine you’re explaining the topic to an 8-year-old, like your cousin. Use simple language, analogies, and examples that make it easier to understand. The goal is to simplify it as much as possible. |
14 | 14 |
|
15 | | -Vuelve a explicarlo, de nuevo más simple: Ahora, después de esa reflexión, repite la explicación, pero con más claridad y simplificación, enfocándote en las partes que quizás pasaste por alto o no entendiste completamente. En este paso, serás más consciente de los detalles que en la primera explicación pudiste haber simplificado en exceso. Tras esta segunda iteración, estarás listo para explicarlo incluso a alguien más, como tu abuela. |
| 15 | +2. **Reflect on what you’ve explained**: After giving that explanation, take some time to reflect on what you said. Ask yourself if you truly understand every part of the concept. This reflection period allows you to see the problem from a different perspective, as you become aware of the gaps in your knowledge when you compare what you thought you understood with what you can actually explain. |
16 | 16 |
|
17 | | -La Técnica de Feynman es un método de aprendizaje y comprensión que consiste en explicar un concepto nuevo a un niño imaginario para identificar las lagunas en tu comprensión y afianzar lo aprendido . |
| 17 | +3. **Explain it again, but simpler**: Now, after that reflection, repeat the explanation but with more clarity and simplification, focusing on the parts you might have overlooked or didn’t understand completely. In this step, you’ll be more aware of the details that in the first explanation you might have overly simplified. |
18 | 18 |
|
19 | | -Durante esa pausa entre el paso 2 y el 3, tu cerebro ha visto el problema desde una perspectiva a posteriori; tú ya le has soltado al niño lo que creías que era una simplificación soberbia del probelma, así que en el paso 3, además de volver a hacer una enorme simplificación, resaltarás consciente o inconscientemente, detalles que en la primera iteración debías de haber pasado por alto, tratando de "parchear" aquellos conceptos que no le explicaste bien al niño, aun sin saberlo. Estate seguro de que, tras esa segunda explicación, estarás en condiciones de pasar a expllicárselo a tu abuela. |
| 19 | +So formally, Feynman's technique is a method of learning and understanding that involves explaining a new concept to an imaginary child in order to identify gaps in your understanding and reinforce what you’ve learned. During the pause between steps 2 and 3, your brain has seen the problem retrospectively; you’ve already told the child what you thought was a brilliant simplification of the problem, so in step 3, in addition to simplifying further, you’ll consciously or unconsciously highlight details that in the first iteration you might have overlooked, trying to "patch" those concepts you didn’t explain well to the child, even if you didn’t know it. Be sure that after that second explanation, you’ll be able to apply Einstein's criterion! |
20 | 20 |
|
21 | | -# Pero, ¿qué es una red neuronal? |
| 21 | +# But, what is a neural network? |
22 | 22 |
|
23 | | -Convéncete, amigo, si estás leyedno esto te va a tocar explicar esto (si no es demasiado tarde) a alguien que no tiene ni la más remota idea de la respuesta. Yo trataré de decir lo que diría, de hecho esto me sirve de preparación ante la situación. Seamos honestos, ahora mismo me siento ciertamente aburrido. |
| 23 | +Convince yourself, friend, if you’re reading this, you’re going to have to explain this (if it’s not too late) to someone who has no idea what the answer is. I’ll try to write what I would say; in fact, this serves as preparation for the situation. And let’s be honest, right now I feel kind of bored. |
24 | 24 |
|
25 | | -Imagínate que es´tas en tu segundo año de universidad, atendiendo a una clase de Cállculo I sobre integrales dobles. Os han mandado un trabajo tremendamente complicado sobre la parametrización de un volumen de revolución que no sabes por donde coger,así que vas preguntando a tus compañeros opinión sobre cómo lo plantearían ellos: tu compañero que tiene menos idea que tú te dice algo que no tiene ningún tipo de sentido así que te quedas como estabas, el repetidor se hace el listo porque has captado que decía algunas sandeces, el listo de la clase te dice que uses algo llamado "Jacobiano en coordenadas cilíndricas" |
26 | | -así que lo apuntas... Tras un cuestionario a tus 15 compañeros recopilas en tus apuntes lo que te parecen buenas ideas y le pides una tutoría al profesor, que sin ton ni son coge todo el aire y te rompe la hoja a la mitad para seleccionar de tus 32 anotaciones la única que vale la pena. ¿Por qué? ¡porque ya van 16 alumnos alumnos que le piden la misma tutoría! |
| 25 | +Imagine you’re in your second year of university, attending a Calculus II class on double integrals. You’ve been assigned a terribly complicated task about parameterizing a volume of revolution that you don’t know how to approach, so you start asking your classmates for their opinions on how they would approach it: your classmate, who knows less than you, says something that makes no sense, so you’re stuck; the repeat student acts all smart and you’ve noticed he was saying nonsense; the smart student of the class tells you to use something called "Jacobian in cylindrical coordinates," so you write it down... After questioning your 15 classmates, you gather what seems to be good ideas in your notes and request a tutoring session with the professor. The next day, in his office, he suddenly grabs the notebook and rips your paper in half to pick the one thing worth mentioning from your 32 notes. Why? Because 16 students have already asked him for the same tutoring! |
27 | 26 |
|
28 | | -Esto que acabamos de recrear es una muy mala metáfora de lo que es y cómo funciona una red neuronal! Probemos otra vez: |
| 27 | +What we just recreated is a very bad metaphor of what a neural network is and how it works. Let’s try again: |
29 | 28 |
|
30 | | -Imagínate que eres un chef tratando de mejorar una receta de pasta. Tú sabes que lo básico es hacer una buena salsa, pero no estás seguro de qué tipo de especias usar para que tenga el mejor sabor. Así que decides probar con diferentes combinaciones de especias. Tienes un montón de ingredientes, y al principio no sabes qué va a funcionar. Pero, después de probar varias veces, te das cuenta de que, por ejemplo, un toque de albahaca hace maravillas y la pimienta negra resalta el sabor justo como necesitas. Te vas dando cuenta, con cada intento, de qué mezcla tiene más impacto en el sabor final. ¡Así que ajustas tus ingredientes y sigues mejorando tu receta! |
| 29 | +Imagine you’re a chef trying to improve a pasta recipe. You know that the basic thing is making a good sauce, but you’re not sure what spices to use to make it taste the best. So you decide to experiment with different combinations of spices. You have a lot of ingredients, and at first, you don’t know what’s going to work. But after trying several times, you realize that, for example, a hint of basil works wonders, and black pepper brings out the flavor just the way you need it. With each attempt, you learn what combination has the biggest impact on the final flavor. So you adjust your ingredients and keep improving your recipe! |
31 | 30 |
|
32 | | -Esto que volvimos a recrear es una algo mejor metáfora (al menos más clara), porque hemos aprendido de los errores que cometimos al explicarlo la primera vez (recuerda a FEynman!!). VOlvamos a intentarlo; prometo (_escrito a posteriori_) que será la última interación... |
| 31 | +This is a slightly better metaphor (at least clearer) because we’ve learned from the mistakes we made when explaining it the first time (remember Feynman!). Let’s try again; I promise (_written a posteriori_) that this will be the last iteration... |
33 | 32 |
|
34 | | -Imagínate que, en lugar de un chef, eres un detective resolviendo un misterio. Tienes montones de pistas que no sabes si son relevantes. Al principio, algunas de ellas no parecen tener sentido, y otras te llevan por caminos equivocados. Pero a medida que avanzas, vas aprendiendo a identificar qué pistas son más importantes y cómo se conectan entre sí. Cada pista te da una pequeña parte de la solución, y poco a poco, vas armando el rompecabezas. ¡Al final, tienes todo resuelto y el misterio completamente claro! |
| 33 | +Imagine that you’re a detective solving a mystery. You have lots of clues, but you don’t know if they’re relevant. At first, some of them don’t seem to make sense, and others lead you down the wrong paths. But as you go on, you learn to identify which clues are more important and how they connect with each other. Each clue gives you a small part of the solution, and little by little, you piece the puzzle together. In the end, you have everything solved and the mystery completely clear! |
35 | 34 |
|
36 | | -Vale, Esta metáfora _ya sí lo tiene todo_, ahora seguro que ya te ha quedado claro qué es una red neuronal sin falta de ponerme técnico ni de nombrar términos técnicnos (ni uno solo) como bias, weight, neocognitrón, perceptrón, capa oculpa, capa densa, backprogpagation, etc... ¿Aún no? De acuerdo, pues mira esto. Así funciona una red neuronal a través de nuestras metáforas: |
37 | | -1. La diferencia entre lo que nuestro alumno sabía (o intuía saber) y lo que captaba/capturaba que sabían sus compañeros era la función de coste a minimizar (por lo menos, eĺ quería minimizar la diferencia de sabiduría entre él y el profesor!!! [entre lo que la red predice y la respuesta correcta]), las respuestas de sus compañeros eran combinaciones lineales, (sus propios compañeros y él eran neuronas), sus respuestas en conjunción a través de las tutorías representaban pooling y message passing y nuestro querido profesor pretendía ser una función de activación no lineal... |
38 | | -2. la receta del chef esla red neuronal y los ingredientes son los diferentes parámetros (e.g. pesos los pesos de las conexiones entre neuronas), que se ajustan mientras la red aprende. Al principio, esos ingredientes no están bien balanceados, pero a medida que el chef prueba, prueba y prueba, va mejorando la receta. Con cada intento, ajusta esos parámetros para dar una mejor respuesta, aprendiendo de cada error para afinar el resultado final. ¡Y al final, tienes la receta perfecta! |
39 | | -3. el detective comienza con muchas pistas (datos) y, tras muchas pruebas y ajustes, va sacando sentido de ellas para dar la mejor respuesta. Cuando una idea le hace "click", es que la funciones de activación gha soltado una respuesta, deshechando hipótesis falsas sobre el culpable... (caracteŕisticas de los datos de entrada no representativas => "cambiemos de enfoque"...). |
| 35 | +Okay, this metaphor _now completes everything_. At this point I’m sure you understand what a neural network is without the need to even mention technical terms (not a single one) like bias, weight, neocognitron, perceptron, hidden layer, dense layer, backpropagation, etc... Still not clear? Alright, then check this out ~~and explain the joke~~. This is how a neural network works through our metaphors: |
40 | 36 |
|
41 | | -Espera, de hecho, este propio post es una hyper-metáfora (quasi-metáfora?, META-METÁFORA??) sobre el funcionamiento de una red neuronal... párate a pensaro... :emoji_de_pensamiento. |
| 37 | +1. The difference between what our student knew (or thought he knew) and what he gathered that his classmates knew was the cost function to minimize (at least, he wanted to minimize the gap of knowledge between him and the professor! [between what the network predicts and the correct answer]), the responses from his classmates were linear combinations (and his classmates and he were neurons), their responses together through tutoring represented pooling and message passing, and our dear professor was trying to be a nonlinear activation function... |
| 38 | + |
| 39 | +2. The chef's recipe is the neural network, and the ingredients are the different parameters (e.g. the weights of the connections between neurons) that get adjusted as the network learns. At first, those ingredients aren’t balanced, but as the chef tries, tries, and tries, he improves the recipe. With each attempt, he adjusts those parameters to provide a better response, learning from every mistake to refine the final result. And in the end, you have the perfect recipe! |
42 | 40 |
|
43 | | -Creo que ahora tienes las herramientas para explicárselo a quien más prefieras. |
| 41 | +3. The detective starts with many clues (raw data) and, after many tests and adjustments, he makes sense of them to come up with the best answer. When an idea "clicks", it’s because the activation function has provided an answer, discarding false hypotheses about the culprit... (_characteristics of the input data that are not representative? => "let’s change our approach..."_). |
44 | 42 |
|
45 | | -Gracias por la lectura. |
| 43 | +Wait, in fact, this post itself is a hyper-metaphor (quasi-metaphor?, META-METAPHOR??) about how a neural network works... stop and think about it... :thinking_emoji: |
46 | 44 |
|
47 | | -~~Formalmente, la idea central es extraer combinaciones lineales de las entradas como derived features, y luego model the target as a nonlinear function of these features~~ |
| 45 | +I think you now have the tools to explain it to whoever you prefer. |
48 | 46 |
|
| 47 | +Thanks for reading. |
| 48 | + |
| 49 | +~~Formally, the central idea is to extract linear combinations of the inputs as derived features, and then model the target as a nonlinear function of these features~~ |
49 | 50 |
|
0 commit comments