# But what is a neural network? | Deep learning chapter 1

https://www.youtube.com/watch?v=aircAruvnKk
Translation: pt

[00:04] This is a 3.
  Este é um 3.

[00:06] It's sloppily written and rendered at an extremely low resolution of 28x28 pixels, but your brain has no trouble recognizing it as a 3.
  Ele está escrito de forma desleixada e renderizado em uma resolução extremamente baixa de 28x28 pixels, mas seu cérebro não tem dificuldade em reconhecê-lo como um 3.

[00:14] And I want you to take a moment to appreciate how crazy it is that brains can do this so effortlessly.
  E eu quero que você tire um momento para apreciar o quão louco é que os cérebros possam fazer isso sem esforço.

[00:19] I mean, this, this and this are also recognizable as 3s, even though the specific values of each pixel is very different from one image to the next.
  Quero dizer, este, este e este também são reconhecíveis como 3s, embora os valores específicos de cada pixel sejam muito diferentes de uma imagem para a outra.

[00:28] The particular light-sensitive cells in your eye that are firing when you see this 3 are very different from the ones firing when you see this 3.
  As células fotossensíveis específicas em seu olho que estão disparando quando você vê este 3 são muito diferentes daquelas que disparam quando você vê este 3.

[00:37] But something in that crazy-smart visual cortex of yours resolves these as representing the same idea, while at the same time recognizing other images as their own distinct ideas.
  Mas algo naquele seu córtex visual incrivelmente inteligente resolve isso como representando a mesma ideia, enquanto ao mesmo tempo reconhece outras imagens como suas próprias ideias distintas.

[00:49] But if I told you, hey, sit down and write for me a program that takes in a grid of 28x28 pixels like this and outputs a single number between 0 and 10, telling you what it thinks the digit is, well the task goes from comically trivial to
  Mas se eu lhe dissesse, ei, sente-se e escreva para mim um programa que receba uma grade de 28x28 pixels como esta e gere um único número entre 0 e 10, dizendo o que ele acha que o dígito é, bem, a tarefa passa de comicamente trivial para

[01:04] Dauntingly difficult.
  Assustadoramente difícil.

[01:07] Unless you've been living under a rock, I think I hardly need to motivate the relevance and importance of machine learning and neural networks to the present and to the future.
  A menos que você tenha vivido debaixo de uma pedra, acho que dificilmente preciso motivar a relevância e a importância do aprendizado de máquina e das redes neurais para o presente e para o futuro.

[01:15] But what I want to do here is show you what a neural network actually is, assuming no background, and to help visualize what it's doing, not as a buzzword but as a piece of math.
  Mas o que quero fazer aqui é mostrar o que uma rede neural realmente é, assumindo que não haja conhecimento prévio, e ajudar a visualizar o que ela está fazendo, não como uma palavra da moda, mas como uma peça matemática.

[01:25] My hope is that you come away feeling like the structure itself is motivated, and to feel like you know what it means when you read, or you hear about a neural network quote-unquote learning.
  Minha esperança é que você saia sentindo que a estrutura em si é motivada, e sentindo que sabe o que significa quando você lê, ou ouve sobre uma rede neural, entre aspas, aprendendo.

[01:35] This video is just going to be devoted to the structure component of that, and the following one is going to tackle learning.
  Este vídeo será dedicado apenas ao componente de estrutura disso, e o próximo abordará o aprendizado.

[01:41] What we're going to do is put together a neural network that can learn to recognize handwritten digits.
  O que vamos fazer é montar uma rede neural que possa aprender a reconhecer dígitos escritos à mão.

[01:49] This is a somewhat classic example for introducing the topic, and I'm happy to stick with the status quo here, because at the end of the two videos I want to point you to a couple good resources where you can learn more, and where you can download the code that does this and play with it on your own computer.
  Este é um exemplo um tanto clássico para introduzir o tópico, e estou feliz em manter o status quo aqui, porque ao final dos dois vídeos quero indicar alguns bons recursos onde você pode aprender mais, e onde você pode baixar o código que faz isso e brincar com ele no seu próprio computador.

[02:05] There are many many variants of neural networks.
  Existem muitas, muitas variantes de redes neurais.

[02:07] And in recent years there's been sort of a boom in research towards these variants.
  E nos últimos anos houve uma espécie de boom na pesquisa voltada para essas variantes.

[02:12] But in these two introductory videos you and I are just going to look at the simplest plain vanilla form with no added frills.
  Mas nestes dois vídeos introdutórios, você e eu vamos apenas olhar para a forma mais simples e básica, sem enfeites adicionais.

[02:19] This is kind of a necessary prerequisite for understanding any of the more powerful modern variants, and trust me it still has plenty of complexity for us to wrap our minds around.
  Este é um pré-requisito necessário para entender qualquer uma das variantes modernas mais poderosas e, acredite em mim, ainda tem complexidade suficiente para compreendermos.

[02:29] But even in this simplest form it can learn to recognize handwritten digits, which is a pretty cool thing for a computer to be able to do.
  Mas mesmo nesta forma mais simples, ela pode aprender a reconhecer dígitos escritos à mão, o que é uma coisa muito legal para um computador ser capaz de fazer.

[02:37] And at the same time you'll see how it does fall short of a couple hopes that we might have for it.
  E, ao mesmo tempo, você verá como ela não atende a algumas expectativas que poderíamos ter em relação a ela.

[02:43] As the name suggests neural networks are inspired by the brain, but let's break that down.
  Como o nome sugere, as redes neurais são inspiradas no cérebro, mas vamos analisar isso.

[02:48] What are the neurons, and in what sense are they linked together?
  O que são os neurônios e em que sentido eles estão ligados?

[02:52] Right now when I say neuron all I want you to think about is a thing that holds a number, specifically a number between 0 and 1.
  Neste momento, quando digo neurônio, tudo o que quero que você pense é em algo que contém um número, especificamente um número entre 0 e 1.

[03:00] It's really not more than that.
  Realmente não é mais do que isso.

[03:03] For example the network starts with a bunch of neurons corresponding to
  Por exemplo, a rede começa com um grupo de neurônios correspondentes a

[03:08] Each of the 28x28 pixels of the input image, which is 784 neurons in total.
  Cada um dos pixels 28x28 da imagem de entrada, o que totaliza 784 neurônios.

[03:14] Each one of these holds a number that represents the grayscale value of the corresponding pixel, ranging from 0 for black pixels up to 1 for white pixels.
  Cada um deles contém um número que representa o valor de escala de cinza do pixel correspondente, variando de 0 para pixels pretos até 1 para pixels brancos.

[03:25] This number inside the neuron is called its activation, and the image you might have in mind here is that each neuron is lit up when its activation is a high number.
  Este número dentro do neurônio é chamado de sua ativação, e a imagem que você pode ter em mente aqui é que cada neurônio se ilumina quando sua ativação é um número alto.

[03:36] So all of these 784 neurons make up the first layer of our network.
  Portanto, todos esses 784 neurônios compõem a primeira camada da nossa rede.

[03:46] Now jumping over to the last layer, this has 10 neurons, each representing one of the digits.
  Agora, pulando para a última camada, esta possui 10 neurônios, cada um representando um dos dígitos.

[03:52] The activation in these neurons, again some number that's between 0 and 1, represents how much the system thinks that a given image corresponds with a given digit.
  A ativação nesses neurônios, novamente algum número entre 0 e 1, representa o quanto o sistema acha que uma determinada imagem corresponde a um determinado dígito.

[04:03] There's also a couple layers in between called the hidden layers, which for the time being should just be a giant question mark for.
  Há também algumas camadas intermediárias chamadas de camadas ocultas, que por enquanto devem ser apenas um ponto de interrogação gigante para.

[04:09] How on earth this process of recognizing digits is going to be handled?
  Como diabos esse processo de reconhecimento de dígitos será tratado?

[04:14] In this network I chose two hidden layers, each one with 16 neurons.
  Nesta rede, escolhi duas camadas ocultas, cada uma com 16 neurônios.

[04:17] And admittedly that's kind of an arbitrary choice.
  E, admitidamente, essa é uma escolha um tanto arbitrária.

[04:21] To be honest I chose two layers based on how I want to motivate the structure in just a moment, and 16, well that was just a nice number to fit on the screen.
  Para ser honesto, escolhi duas camadas com base em como quero motivar a estrutura em um momento, e 16, bem, esse foi apenas um bom número para caber na tela.

[04:28] In practice there is a lot of room for experiment with a specific structure here.
  Na prática, há muito espaço para experimentos com uma estrutura específica aqui.

[04:33] The way the network operates, activations in one layer determine the activations of the next layer.
  A maneira como a rede opera, as ativações em uma camada determinam as ativações da próxima camada.

[04:39] And of course the heart of the network as an information processing mechanism comes down to exactly how those activations from one layer bring about activations in the next layer.
  E, claro, o coração da rede como um mecanismo de processamento de informação se resume exatamente a como essas ativações de uma camada provocam ativações na próxima camada.

[04:49] It's meant to be loosely analogous to how in biological networks of neurons, some groups of neurons firing cause certain others to fire.
  Isso pretende ser vagamente análogo a como, em redes biológicas de neurônios, alguns grupos de neurônios disparando fazem com que outros disparem.

[04:58] Now the network I'm showing here has already been trained to recognize digits, and let me show you what I mean by that.
  Agora, a rede que estou mostrando aqui já foi treinada para reconhecer dígitos, e deixe-me mostrar o que quero dizer com isso.

[05:03] It means if you feed in an image, lighting up all 784 neurons of the input layer according to the brightness of each pixel in the image,
  Isso significa que, se você inserir uma imagem, iluminando todos os 784 neurônios da camada de entrada de acordo com o brilho de cada pixel na imagem,

[05:11] That pattern of activations causes some very specific pattern in the next layer.
  Esse padrão de ativações causa um padrão muito específico na próxima camada.

[05:16] Which causes some pattern in the one after it, which finally gives some pattern in the output layer.
  O que causa algum padrão na camada seguinte, que finalmente resulta em um padrão na camada de saída.

[05:22] And the brightest neuron of that output layer is the network's choice, so to speak, for what digit this image represents.
  E o neurônio mais brilhante dessa camada de saída é a escolha da rede, por assim dizer, para qual dígito esta imagem representa.

[05:32] And before jumping into the math for how one layer influences the next, or how training works, let's just talk about why it's even reasonable to expect a layered structure like this to behave intelligently.
  E antes de pular para a matemática de como uma camada influencia a próxima, ou como o treinamento funciona, vamos apenas falar sobre por que é razoável esperar que uma estrutura em camadas como esta se comporte de forma inteligente.

[05:44] What are we expecting here?
  O que estamos esperando aqui?

[05:45] What is the best hope for what those middle layers might be doing?
  Qual é a melhor esperança para o que essas camadas intermediárias podem estar fazendo?

[05:48] Well, when you or I recognize digits, we piece together various components.
  Bem, quando você ou eu reconhecemos dígitos, nós juntamos vários componentes.

[05:54] A 9 has a loop up top and a line on the right.
  Um 9 tem um laço no topo e uma linha à direita.

[05:57] An 8 also has a loop up top, but it's paired with another loop down low.
  Um 8 também tem um laço no topo, mas é emparelhado com outro laço na parte inferior.

[06:02] A 4 basically breaks down into three specific lines, and things like that.
  Um 4 basicamente se divide em três linhas específicas, e coisas do tipo.

[06:07] Now in a perfect world, we might hope that each neuron in the second.
  Agora, em um mundo perfeito, poderíamos esperar que cada neurônio na segunda.

[06:11] To last layer corresponds with one of these subcomponents.
  A última camada corresponde a um desses subcomponentes.

[06:15] That anytime you feed in an image with, say, a loop up top, like a 9 or an 8, there's some specific neuron whose activation is going to be close to 1.
  Que sempre que você insere uma imagem com, digamos, um laço no topo, como um 9 ou um 8, existe algum neurônio específico cuja ativação estará próxima de 1.

[06:24] And I don't mean this specific loop of pixels, the hope would be that any generally loopy pattern towards the top sets off this neuron.
  E não me refiro a este laço específico de pixels; a esperança seria que qualquer padrão geralmente arredondado em direção ao topo ative este neurônio.

[06:32] That way, going from the third layer to the last one just requires learning which combination of subcomponents corresponds to which digits.
  Dessa forma, ir da terceira camada para a última requer apenas aprender qual combinação de subcomponentes corresponde a quais dígitos.

[06:41] Of course, that just kicks the problem down the road, because how would you recognize these subcomponents, or even learn what the right subcomponents should be?
  Claro, isso apenas adia o problema, porque como você reconheceria esses subcomponentes, ou até mesmo aprenderia quais deveriam ser os subcomponentes corretos?

[06:48] And I still haven't even talked about how one layer influences the next, but run with me on this one for a moment.
  E eu ainda nem falei sobre como uma camada influencia a próxima, mas acompanhe-me nisso por um momento.

[06:53] Recognizing a loop can also break down into subproblems.
  Reconhecer um laço também pode ser dividido em subproblemas.

[06:57] One reasonable way to do this would be to first recognize the various little edges that make it up.
  Uma maneira razoável de fazer isso seria primeiro reconhecer as várias pequenas arestas que o compõem.

[07:03] Similarly, a long line, like the kind you might see in the digits 1 or 4 or 7, is really just a long edge, or maybe you think of it as a certain pattern of several.
  Da mesma forma, uma linha longa, como o tipo que você pode ver nos dígitos 1, 4 ou 7, é na verdade apenas uma aresta longa, ou talvez você pense nela como um certo padrão de várias.

[07:13] Smaller edges.
  Bordas menores.

[07:15] So maybe our hope is that each neuron in the second layer of the network corresponds with the various relevant little edges.
  Então talvez nossa esperança seja que cada neurônio na segunda camada da rede corresponda às várias pequenas bordas relevantes.

[07:23] Maybe when an image like this one comes in, it lights up all of the neurons associated with around 8 to 10 specific little edges, which in turn lights up the neurons associated with the upper loop and a long vertical line, and those light up the neuron associated with a 9.
  Talvez quando uma imagem como esta entra, ela ilumina todos os neurônios associados a cerca de 8 a 10 pequenas bordas específicas, o que por sua vez ilumina os neurônios associados ao loop superior e a uma longa linha vertical, e esses iluminam o neurônio associado a um 9.

[07:40] Whether or not this is what our final network actually does is another question, one that I'll come back to once we see how to train the network, but this is a hope that we might have, a sort of goal with the layered structure like this.
  Se isso é ou não o que nossa rede final realmente faz é outra questão, uma à qual voltarei assim que virmos como treinar a rede, mas esta é uma esperança que podemos ter, uma espécie de objetivo com uma estrutura em camadas como esta.

[07:53] Moreover, you can imagine how being able to detect edges and patterns like this would be really useful for other image recognition tasks.
  Além disso, você pode imaginar como ser capaz de detectar bordas e padrões como este seria realmente útil para outras tarefas de reconhecimento de imagem.

[08:00] And even beyond image recognition, there are all sorts of intelligent things you might want to do that break down into layers of abstraction.
  E mesmo além do reconhecimento de imagem, existem todos os tipos de coisas inteligentes que você pode querer fazer que se dividem em camadas de abstração.

[08:08] Parsing speech, for example, involves taking raw audio and picking out distinct sounds, which combine to make certain syllables, which combine to form words.
  Analisar a fala, por exemplo, envolve pegar áudio bruto e selecionar sons distintos, que se combinam para formar certas sílabas, que se combinam para formar palavras.

[08:16] Which combine to make up phrases and more abstract thoughts, etc.
  Que se combinam para formar frases e pensamentos mais abstratos, etc.

[08:21] But getting back to how any of this actually works, picture yourself right now designing how exactly the activations in one layer might determine the activations in the next.
  Mas voltando a como tudo isso realmente funciona, imagine-se agora projetando exatamente como as ativações em uma camada podem determinar as ativações na próxima.

[08:30] The goal is to have some mechanism that could conceivably combine pixels into edges, or edges into patterns, or patterns into digits.
  O objetivo é ter algum mecanismo que pudesse concebivelmente combinar pixels em bordas, ou bordas em padrões, ou padrões em dígitos.

[08:39] And to zoom in on one very specific example, let's say the hope is for one particular neuron in the second layer to pick up on whether or not the image has an edge in this region here.
  E para focar em um exemplo muito específico, digamos que a esperança seja que um neurônio particular na segunda camada identifique se a imagem tem ou não uma borda nesta região aqui.

[08:51] The question at hand is what parameters should the network have?
  A questão em pauta é: quais parâmetros a rede deve ter?

[08:55] What dials and knobs should you be able to tweak so that it's expressive enough to potentially capture this pattern, or any other pixel pattern, or the pattern that several edges can make a loop, and other such things?
  Quais mostradores e botões você deveria ser capaz de ajustar para que ela seja expressiva o suficiente para potencialmente capturar este padrão, ou qualquer outro padrão de pixel, ou o padrão de que várias bordas podem formar um loop, e outras coisas do tipo?

[09:08] Well, what we'll do is assign a weight to each one of the connections between our neuron and the neurons from the first layer.
  Bem, o que faremos é atribuir um peso a cada uma das conexões entre nosso neurônio e os neurônios da primeira camada.

[09:16] These weights are just numbers.
  Esses pesos são apenas números.

[09:18] Then take all of those activations from the first layer and compute their weighted sum according to these weights.
  Então, pegue todas essas ativações da primeira camada e calcule sua soma ponderada de acordo com esses pesos.

[09:27] I find it helpful to think of these weights as being organized into a little grid of their own, and I'm going to use green pixels to indicate positive weights, and red pixels to indicate negative weights, where the brightness of that pixel is some loose depiction of the weight's value.
  Acho útil pensar nesses pesos como se estivessem organizados em sua própria pequena grade, e vou usar pixels verdes para indicar pesos positivos e pixels vermelhos para indicar pesos negativos, onde o brilho desse pixel é uma representação aproximada do valor do peso.

[09:42] Now if we made the weights associated with almost all of the pixels zero except for some positive weights in this region that we care about, then taking the weighted sum of all the pixel values really just amounts to adding up the values of the pixel just in the region that we care about.
  Agora, se tornássemos os pesos associados a quase todos os pixels zero, exceto por alguns pesos positivos nesta região que nos interessa, então calcular a soma ponderada de todos os valores dos pixels equivale apenas a somar os valores dos pixels apenas na região que nos interessa.

[09:59] And if you really wanted to pick up on whether there's an edge here, what you might do is have some negative weights associated with the surrounding pixels.
  E se você realmente quisesse detectar se há uma borda aqui, o que você poderia fazer é ter alguns pesos negativos associados aos pixels ao redor.

[10:07] Then the sum is largest when those middle pixels are bright but the surrounding pixels are darker.
  Então, a soma é maior quando esses pixels centrais estão brilhantes, mas os pixels ao redor estão mais escuros.

[10:14] When you compute a weighted sum like this, you might come out with any number,
  Ao calcular uma soma ponderada como esta, você pode obter qualquer número,

[10:18] But for this network, what we want is for activations to be some value between 0 and 1.
  Mas para esta rede, o que queremos é que as ativações sejam algum valor entre 0 e 1.

[10:24] So a common thing to do is to pump this weighted sum into some function that squishes the real number line into the range between 0 and 1.
  Portanto, uma coisa comum a se fazer é inserir essa soma ponderada em alguma função que comprima a reta numérica real para o intervalo entre 0 e 1.

[10:32] And a common function that does this is called the sigmoid function, also known as a logistic curve.
  E uma função comum que faz isso é chamada de função sigmoide, também conhecida como curva logística.

[10:38] Basically, very negative inputs end up close to 0, positive inputs end up close to 1, and it just steadily increases around the input 0.
  Basicamente, entradas muito negativas terminam perto de 0, entradas positivas terminam perto de 1, e ela aumenta de forma constante em torno da entrada 0.

[10:49] So the activation of the neuron here is basically a measure of how positive the relevant weighted sum is.
  Portanto, a ativação do neurônio aqui é basicamente uma medida de quão positiva é a soma ponderada relevante.

[10:57] But maybe it's not that you want the neuron to light up when the weighted sum is bigger than 0.
  Mas talvez não seja que você queira que o neurônio acenda quando a soma ponderada for maior que 0.

[11:02] Maybe you only want it to be active when the sum is bigger than, say, 10.
  Talvez você só queira que ele fique ativo quando a soma for maior que, digamos, 10.

[11:06] That is, you want some bias for it to be inactive.
  Ou seja, você quer algum viés para que ele fique inativo.

[11:11] What we'll do then is just add in some other number like negative 10 to this weighted sum before plugging it through the sigmoid squishification function.
  O que faremos então é apenas adicionar algum outro número, como menos 10, a essa soma ponderada antes de passá-la pela função de compressão sigmoide.

[11:20] That additional number is called the bias.
  Esse número adicional é chamado de viés.

[11:23] So the weights tell you what pixel pattern this neuron in the second layer is picking up on, and the bias tells you how high the weighted sum needs to be before the neuron starts getting meaningfully active.
  Portanto, os pesos indicam qual padrão de pixel este neurônio na segunda camada está detectando, e o viés indica quão alta a soma ponderada precisa ser antes que o neurônio comece a ficar significativamente ativo.

[11:36] And that is just one neuron.
  E esse é apenas um neurônio.

[11:38] Every other neuron in this layer is going to be connected to all 784 pixel neurons from the first layer, and each one of those 784 connections has its own weight associated with it.
  Todos os outros neurônios nesta camada estarão conectados a todos os 784 neurônios de pixel da primeira camada, e cada uma dessas 784 conexões tem seu próprio peso associado a ela.

[11:51] Also, each one has some bias, some other number that you add on to the weighted sum before squishing it with the sigmoid.
  Além disso, cada um tem algum viés, algum outro número que você adiciona à soma ponderada antes de comprimi-la com a sigmoide.

[11:58] And that's a lot to think about!
  E isso é muita coisa para se pensar!

[12:00] With this hidden layer of 16 neurons, that's a total of 784 times 16 weights, along with 16 biases.
  Com esta camada oculta de 16 neurônios, isso totaliza 784 vezes 16 pesos, juntamente com 16 vieses.

[12:08] And all of that is just the connections from the first layer to the second.
  E tudo isso são apenas as conexões da primeira camada para a segunda.

[12:12] The connections between the other layers also have a bunch of weights and biases associated with them.
  As conexões entre as outras camadas também possuem um monte de pesos e vieses associados a elas.

[12:18] All said and done, this network has almost exactly 13,000 total weights and biases.
  No final das contas, esta rede tem quase exatamente 13.000 pesos e vieses no total.

[12:23] 13,000 knobs and dials that can be tweaked and turned to make this network behave in different ways.
  13.000 botões e seletores que podem ser ajustados e girados para fazer com que esta rede se comporte de maneiras diferentes.

[12:31] So when we talk about learning, what that's referring to is getting the computer to find a valid setting for all of these many many numbers so that it'll actually solve the problem at hand.
  Portanto, quando falamos sobre aprendizado, o que isso significa é fazer com que o computador encontre uma configuração válida para todos esses muitos números, para que ele realmente resolva o problema em questão.

[12:42] One thought experiment that is at once fun and kind of horrifying is to imagine sitting down and setting all of these weights and biases by hand, purposefully tweaking the numbers so that the second layer picks up on edges, the third layer picks up on patterns, etc.
  Um experimento mental que é ao mesmo tempo divertido e um tanto horripilante é imaginar sentar-se e definir todos esses pesos e vieses manualmente, ajustando propositalmente os números para que a segunda camada identifique bordas, a terceira camada identifique padrões, etc.

[12:57] I personally find this satisfying rather than just treating the network as a total black box, because when the network doesn't perform the way you anticipate, if you've built up a little bit of a relationship with what those weights and biases actually mean, you have a starting place for experimenting with how to change the structure to improve.
  Eu pessoalmente acho isso satisfatório, em vez de apenas tratar a rede como uma caixa preta total, porque quando a rede não funciona como você prevê, se você construiu um pequeno relacionamento com o que esses pesos e vieses realmente significam, você tem um ponto de partida para experimentar como mudar a estrutura para melhorar.

[13:15] Or when the network does work but not for the reasons you might expect, digging into what the weights and biases are doing is a good way to challenge your assumptions and really expose the full space of possible solutions.
  Ou quando a rede funciona, mas não pelos motivos que você esperaria, investigar o que os pesos e vieses estão fazendo é uma boa maneira de desafiar suas suposições e realmente expor todo o espaço de soluções possíveis.

[13:26] By the way, the actual function here is a little cumbersome to write down, don't you think?
  A propósito, a função real aqui é um pouco complicada de escrever, você não acha?

[13:32] So let me show you a more notationally compact way that these connections are represented.
  Então, deixe-me mostrar uma maneira mais compacta em termos de notação de representar essas conexões.

[13:37] This is how you'd see it if you choose to read up more about neural networks.
  É assim que você veria se decidisse ler mais sobre redes neurais.

[13:40] Organize all of the activations from one layer into a column as a vector.
  Organize todas as ativações de uma camada em uma coluna como um vetor.

[13:48] Then organize all of the weights as a matrix, where each row of that matrix corresponds to the connections between one layer and a particular neuron in the next layer.
  Em seguida, organize todos os pesos como uma matriz, onde cada linha dessa matriz corresponde às conexões entre uma camada e um neurônio específico na camada seguinte.

[13:58] What that means is that taking the weighted sum of the activations in the first layer according to these weights corresponds to one of the terms in the matrix vector product of everything we have on the left here.
  O que isso significa é que calcular a soma ponderada das ativações na primeira camada de acordo com esses pesos corresponde a um dos termos no produto matriz-vetor de tudo o que temos à esquerda aqui.

[14:14] By the way, so much of machine learning just comes down to having a good grasp of linear algebra, so for any of you who want a nice visual understanding for matrices and what matrix vector multiplication means, take a look at the series I did on linear algebra, especially chapter 3.
  A propósito, grande parte do aprendizado de máquina resume-se a ter uma boa compreensão da álgebra linear, então, para qualquer um de vocês que queira uma boa compreensão visual de matrizes e do que significa a multiplicação matriz-vetor, dê uma olhada na série que fiz sobre álgebra linear, especialmente o capítulo 3.

[14:29] Back to our expression, instead of talking about adding the bias to each one of these values independently, we represent it by organizing all those biases into a vector, and adding the entire vector to the previous matrix vector product.
  Voltando à nossa expressão, em vez de falar sobre adicionar o viés a cada um desses valores independentemente, nós o representamos organizando todos esses vieses em um vetor e adicionando o vetor inteiro ao produto anterior de matriz por vetor.

[14:43] Then as a final step, I'll wrap a sigmoid around the outside here, and what that's supposed to represent is that you're going to apply the sigmoid function to each specific component of the resulting vector inside.
  Então, como passo final, vou envolver uma sigmoide na parte externa aqui, e o que isso deve representar é que você aplicará a função sigmoide a cada componente específico do vetor resultante dentro.

[14:55] So once you write down this weight matrix and these vectors as their own symbols, you can communicate the full transition of activations from one layer to the next in an extremely tight and neat little expression, and this makes the relevant code both a lot simpler and a lot faster, since many libraries optimize the heck out of matrix multiplication.
  Portanto, uma vez que você escreve esta matriz de pesos e esses vetores como seus próprios símbolos, você pode comunicar a transição completa das ativações de uma camada para a próxima em uma expressão extremamente concisa e organizada, e isso torna o código relevante muito mais simples e muito mais rápido, já que muitas bibliotecas otimizam ao máximo a multiplicação de matrizes.

[15:17] Remember how earlier I said these neurons are simply things that hold numbers?
  Lembra como eu disse anteriormente que esses neurônios são simplesmente coisas que contêm números?

[15:22] Well of course the specific numbers that they hold depends on the image you feed in, so it's actually more accurate to think of each neuron as a function,
  Bem, é claro que os números específicos que eles contêm dependem da imagem que você insere, então é, na verdade, mais preciso pensar em cada neurônio como uma função,

[15:31] One that takes in the outputs of all the neurons in the previous layer and spits out a number between 0 and 1.
  Uma que recebe as saídas de todos os neurônios da camada anterior e cospe um número entre 0 e 1.

[15:39] Really the entire network is just a function, one that takes in 784 numbers as an input and spits out 10 numbers as an output.
  Na verdade, toda a rede é apenas uma função, uma que recebe 784 números como entrada e cospe 10 números como saída.

[15:47] It's an absurdly complicated function, one that involves 13,000 parameters in the forms of these weights and biases that pick up on certain patterns, and which involves iterating many matrix vector products and the sigmoid squishification function, but it's just a function nonetheless.
  É uma função absurdamente complicada, que envolve 13.000 parâmetros na forma desses pesos e vieses que captam certos padrões, e que envolve a iteração de muitos produtos de matriz por vetor e a função de esmagamento sigmoide, mas ainda assim é apenas uma função.

[16:03] And in a way it's kind of reassuring that it looks complicated.
  E, de certa forma, é reconfortante que pareça complicada.

[16:07] I mean if it were any simpler, what hope would we have that it could take on the challenge of recognizing digits?
  Quero dizer, se fosse mais simples, que esperança teríamos de que ela pudesse enfrentar o desafio de reconhecer dígitos?

[16:13] And how does it take on that challenge?
  E como ela enfrenta esse desafio?

[16:15] How does this network learn the appropriate weights and biases just by looking at data?
  Como essa rede aprende os pesos e vieses apropriados apenas olhando para os dados?

[16:20] Well that's what I'll show in the next video, and I'll also dig a little more into what this particular network we're seeing is really doing.
  Bem, é isso que mostrarei no próximo vídeo, e também me aprofundarei um pouco mais no que essa rede específica que estamos vendo está realmente fazendo.

[16:27] Now is the point I suppose I should say subscribe to stay notified about when that video or any new videos come out.
  Agora é o momento em que suponho que devo dizer para se inscrever para ficar notificado sobre quando esse vídeo ou quaisquer novos vídeos forem lançados.

[16:33] But realistically, most of you don't actually receive notifications from YouTube, do you?
  Mas, realisticamente, a maioria de vocês não recebe notificações do YouTube, não é?

[16:38] Maybe more honestly I should say subscribe so that the neural networks that underlie YouTube's recommendation algorithm are primed to believe that you want to see content from this channel get recommended to you.
  Talvez, sendo mais honesto, eu devesse dizer para se inscreverem, para que as redes neurais que sustentam o algoritmo de recomendação do YouTube sejam preparadas para acreditar que vocês querem que o conteúdo deste canal seja recomendado a vocês.

[16:48] Anyway, stay posted for more.
  De qualquer forma, fiquem atentos para mais.

[16:50] Thank you very much to everyone supporting these videos on Patreon.
  Muito obrigado a todos que apoiam estes vídeos no Patreon.

[16:54] I've been a little slow to progress in the probability series this summer, but I'm jumping back into it after this project, so patrons you can look out for updates there.
  Tenho progredido um pouco devagar na série de probabilidade neste verão, mas vou retomar o trabalho após este projeto, então, patronos, podem aguardar por atualizações lá.

[17:03] To close things off here I have with me Lisha Li who did her PhD work on the theoretical side of deep learning and who currently works at a venture capital firm called Amplify Partners who kindly provided some of the funding for this video.
  Para encerrar, tenho comigo Lisha Li, que fez seu doutorado no lado teórico do aprendizado profundo e que atualmente trabalha em uma empresa de capital de risco chamada Amplify Partners, que gentilmente forneceu parte do financiamento para este vídeo.

[17:15] So Lisha, one thing I think we should quickly bring up is this sigmoid function.
  Então, Lisha, uma coisa que acho que deveríamos mencionar rapidamente é esta função sigmoide.

[17:19] As I understand it, early networks use this to squish the relevant weighted sum into that interval between zero and one, you know, kind of motivated by this biological analogy of neurons either being inactive or active.
  Pelo que entendi, as primeiras redes usavam isso para comprimir a soma ponderada relevante naquele intervalo entre zero e um, sabe, motivadas pela analogia biológica de neurônios estarem inativos ou ativos.

[17:30] Exactly.
  Exatamente.

[17:30] But relatively few modern networks actually use sigmoid anymore.
  Mas, relativamente, poucas redes modernas ainda usam a sigmoide.

[17:34] Yeah.
  Sim.

[17:34] It's kind of old school, right?
  É meio antiquado, certo?

[17:35] Yeah, or rather ReLU seems to be much easier to train.
  Sim, ou melhor, ReLU parece ser muito mais fácil de treinar.

[17:39] And ReLU, ReLU stands for rectified linear unit?
  E ReLU, ReLU significa unidade linear retificada?

[17:42] Yes, it's this kind of function where you're just taking a max of zero and a, where a is given by what you were explaining in the video.
  Sim, é esse tipo de função onde você apenas pega o máximo de zero e a, onde a é dado pelo que você estava explicando no vídeo.

[17:52] And what this was sort of motivated from, I think, was partially by a biological analogy with how neurons would either be activated or not.
  E o que motivou isso, eu acho, foi parcialmente uma analogia biológica com a forma como os neurônios seriam ativados ou não.

[18:01] And so if it passes a certain threshold, it would be the identity function, but if it did not, then it would just not be activated, so it'd be zero, so it's kind of a simplification.
  Então, se passar de um certo limite, seria a função identidade, mas se não passasse, então simplesmente não seria ativado, então seria zero, então é uma espécie de simplificação.

[18:11] Using sigmoids didn't help training, or it was very difficult to train at some point, and people just tried ReLU and it happened to work very well for these incredibly deep neural networks.
  Usar sigmoides não ajudou no treinamento, ou foi muito difícil treinar em algum momento, e as pessoas simplesmente tentaram ReLU e acabou funcionando muito bem para essas redes neurais incrivelmente profundas.

[18:25] All right, thank you, Lisha.
  Tudo bem, obrigado, Lisha.
