node-red 可视化
有关深层学习的FAU讲义 (FAU LECTURE NOTES ON DEEP LEARNING)
These are the lecture notes for FAU’s YouTube Lecture “Deep Learning”. This is a full transcript of the lecture video & matching slides. We hope, you enjoy this as much as the videos. Of course, this transcript was created with deep learning techniques largely automatically and only minor manual modifications were performed. Try it yourself! If you spot mistakes, please let us know!
这些是FAU YouTube讲座“ 深度学习 ”的 讲义 。 这是演讲视频和匹配幻灯片的完整记录。 我们希望您喜欢这些视频。 当然,此成绩单是使用深度学习技术自动创建的,并且仅进行了较小的手动修改。 自己尝试! 如果发现错误,请告诉我们!
导航 (Navigation)
Previous Lecture / Watch this Video / Top Level / Next Lecture
![Image for post](https://miro.medium.com/freeze/max/9999/0*8cF7kzUWK8xT886R.gif)
Welcome everybody to our deep learning lecture! Today we want to talk a bit about visualization and attention mechanisms. Okay, so let’s start looking into visualization and attention mechanisms. So we’ll first look into the motivation then we want to discuss network architecture visualizations. Lastly, we want to look into the visualization of the training and training parameters that you’ve already seen in this lecture. In the next couple of videos, we want to talk about actually the visualization of the parameters so the inner workings and why we would actually be interested in doing that. Finally, we will look into the attention mechanisms. So this will be the fifth video of this short series.
欢迎大家参加我们的深度学习讲座! 今天,我们想谈谈可视化和注意力机制。 好的,让我们开始研究可视化和注意力机制。 因此,我们将首先研究动机,然后讨论网络架构可视化。 最后,我们想研究一下您在本讲座中已经看到的训练和训练参数的可视化。 在接下来的两个视频中,我们实际上要讨论参数的可视化,以便了解内部工作原理以及为什么我们对此真正感兴趣。 最后,我们将研究注意力机制。 因此,这将是该短篇系列的第五段视频。
![Image for post](https://miro.medium.com/max/9999/0*A0GuoAJMA_9QhMfH.jpg)
So, let’s talk a bit about motivation. Well, why do we want to visualize anything? Well, of course, the neural networks are often treated as black boxes. so you have some inputs, then something happens with them, and then there are some outputs. Today, we want to look into how to communicate the inner workings of a network to other people like other developers or scientists. You will see that this is an important skill that you will need for your future career.
因此,让我们谈谈动机。 好吧,为什么我们要可视化任何东西? 好吧,当然,神经网络通常被视为黑匣子。 所以您有一些输入,然后它们发生了一些变化,然后有一些输出。 今天,我们想研究如何与其他开发人员或科学家等人交流网络的内部工作原理。 您将看到,这是您未来职业所需的一项重要技能。
![Image for post](https://miro.medium.com/max/9999/0*iblgx1R9EwPYF3XQ.jpg)
So well a couple of reasons why you want to do that. You want to communicate the architectures. You want to identify issues during the training such as if the training doesn’t converge. If you have effects like dying ReLUs, you want to identify faulty training or test data. You want to understand how why and what networks learn. So, there are three main types of visualization that we want to cover here. This is the visualization of the architecture, the visualization of the training, the learned parameters, and weights, and this is then important, of course, for visualization: The representation of the data in the network.
为何要这么做有两个原因。 您想传达架构。 您想在培训期间发现问题,例如培训是否收敛。 如果您有垂死的ReLU之类的影响,则需要确定错误的训练或测试数据。 您想了解网络学习的方式和方式。 因此,在这里我们要介绍三种主要的可视化类型。 这是架构的可视化,培训的可视化,学习的参数和权重,因此,对于可视化而言,这当然很重要:网络中数据的表示。
![Image for post](https://miro.medium.com/max/9999/0*Ruw5FZWDC46H8JHF.jpg)
So, let’s start with network architecture visualization. We essentially want to communicate effectively what is important about this specific type of neural network. The priors that we actually imposed by the architecture may be crucial or even the most important factor for the good performance of a specific network. So mostly this is done graph-based structures with different degrees of granularity you will see some examples in the following. Actually, we’ve already seen this quite often if you compare to our set of lecture videos on neural network architectures. So there are essentially three categories,
因此,让我们从网络架构可视化开始。 我们本质上是想有效地交流关于这种特定类型的神经网络的重要信息。 对于特定网络的良好性能,我们实际上由体系结构强加的先验可能是至关重要的,甚至是最重要的因素。 因此,大多数情况是通过具有不同粒度的基于图的结构完成的,您将在下面看到一些示例。 实际上,如果您将我们的神经网络架构讲座视频与我们相比较,我们已经经常看到这种情况。 因此,基本上有三类,
![Image for post](https://miro.medium.com/max/9999/0*NwwCxc8rRPSt02QA.jpg)
There is the node-link diagram that works essentially on neuron level. You have nodes as neurons and weighted connections as the edges. You’ve seen them especially in the early instances of this class where we really go down onto node level. There really all of the connections matter. They are, for example, useful if you want to show the difference between a convolutional layer or a fully connected layer. So, this is essentially important for small sub-networks or building blocks. There are different variants with explicit weighting recurrent connections and so on.
有一个节点链接图基本上在神经元级别起作用。 您将节点作为神经元,并将加权连接作为边。 您已经看到了它们,尤其是在此类的早期实例中,我们实际上进入了节点级别。 确实所有连接都很重要。 例如,如果要显示卷积层或完全连接的层之间的差异,则它们很有用。 因此,这对于小型子网或构建块至关重要。 有显式加权递归连接的不同变体,依此类推。
![Image for post](https://miro.medium.com/max/9999/0*yIIKQr8AQzTWQ-V1.jpg)
If you want to go for larger structures, then we use block diagrams. There, we have solid blocks. They often share only single connections between the layers although actually all of the neurons are connected to each other. We have seen plenty of these visualizations. Here you can see a visualization for the block diagrams. Here, the block is a mathematical operation or layer. Then, you have arrows, too. They show the flow of the data and the blocks can have different granularity. Often, they use hierarchical descriptions. You may even want to use this in combination with the previous type of diagram such that you make sure which block does what kind of operation. Of course, you need a textural description for the hyperparameters. the filter sizes. and the number of filters. This then very often is done in the caption or you add small numbers which filters are actually used or how many activations and feature maps are used.
如果您想使用更大的结构,则可以使用框图。 在那里,我们有坚固的砖块。 尽管实际上所有神经元都相互连接,但它们通常仅在层之间共享单个连接。 我们已经看到了很多这样的可视化。 在这里,您可以看到框图的可视化。 在这里,块是数学运算或层。 然后,您也有箭头。 它们显示了数据流,并且块可以具有不同的粒度。 通常,他们使用层次描述。 您甚至可能希望将其与以前的图表类型结合使用,以确保确定哪个块执行了哪种操作。 当然,您需要对超参数进行结构化描述。 过滤器尺寸。 和过滤器的数量 然后,这通常是在标题中完成的,或者添加少量数字实际使用的过滤器或使用了多少个激活和功能图。
![Image for post](https://miro.medium.com/max/9999/0*po65y5EIgRhel7Oi.jpg)
We can see there’s quite a variety of visualizations depending on what you want to show. These are two visualizations of AlexNet. The top one is actually from the original publication and it highlights that it is split into two parts because it runs on two GPUs. Then you have the interaction between the two GPUs highlighted by connections between the two branches shown on top. Now, the bottom visualization rather focuses on the convolutional neural network structure and the pooling and convolution layers. In the end, you go to fully connected layers connected to an SVM classifier. So, here more the concept of the architecture is in the focus while both of the images actually show the same architecture.
我们可以看到很多可视化内容,具体取决于您要显示的内容。 这是AlexNet的两种可视化。 顶部实际上来自原始出版物,它着重说明了它分为两个部分,因为它在两个GPU上运行。 然后,您将在顶部显示的两个分支之间的连接突出显示两个GPU之间的交互。 现在,底部可视化主要集中在卷积神经网络结构以及池化和卷积层。 最后,转到连接到SVM分类器的完全连接的层。 因此,这里更多的是体系结构的概念,而两个图像实际上都显示相同的体系结构。
![Image for post](https://miro.medium.com/max/9999/0*bsrXt7xBu662I9x4.jpg)
You’ve already seen that there are also block variants. So you see here the visualization of VGG where the authors wanted to show that they have this decrease in special dimensionality while an increase in the interpretation dimension. So here, only 3-D blocks or cubes are used for the visualization. Here, they convey the idea that you want to switch from the spatial dimension to the interpretation domain. There are many, many different ways of visualizing things. You should pick the one that shows the effect that is important in your opinion. Then, you add a good textural description to that one. The key is in the combination of text and figure in order for others to be able to follow your ideas. Of course, also libraries have tools that display the actually implemented graph structure. Generally, they are not so well-suited for conveying the information to others. Many details are lost or sometimes the grade of granularity is just too high in order to show the entire network. So, this is typically good for debugging, but not so good for reports or conveying the idea of your architecture.
您已经看到了块变体。 因此,您在这里看到了VGG的可视化,在这里作者希望表明他们在特殊维度方面有所减少,而解释维度有所增加。 因此,在这里,只有3-D块或立方体用于可视化。 在这里,他们传达了您想要从空间维度切换到解释域的想法。 有很多很多不同的可视化方式。 您应该选择一种显示重要效果的视图。 然后,为该文本添加良好的纹理描述。 关键在于文本和图形的组合,以便其他人能够遵循您的想法。 当然,库也具有显示实际实现的图形结构的工具。 通常,它们不太适合将信息传达给他人。 许多细节丢失了,或者有时粒度等级太高,无法显示整个网络。 因此,这通常适合调试,但不适用于报表或传达体系结构的想法。
![Image for post](https://miro.medium.com/max/9999/0*IZFizZDkS5eYjGkb.jpg)
Well, there are of course also other visualization strategies. Here, we just have a short overview of what can be done. There are things like Graphcore Poplar which has this fancy graph visualization. You can see that this is a representation of the architecture but it’s not so useful if you try to implement it after this visualization, It is kind of interesting to look at it and to try to understand which part of the network is connected to which one. You can clearly see that the layers can be identified here. So, the different layers and configuration of layers form different shapes. Generally, it’s very hard to look at this image and say okay wow this is a ResNet-50. I would prefer a different visualization of ResNet-50 in order to figure out what’s going on here.
好吧,当然还有其他可视化策略。 在这里,我们只是对可以完成的事情的简短概述。 像Graphcore Poplar之类的东西具有这种精美的图形可视化效果。 您可以看到这是该体系结构的一种表示形式,但是如果您尝试在此可视化之后尝试实现它,它就没那么有用了。查看它并尝试理解网络的哪个部分连接到哪个部分上,这很有意思。 。 您可以清楚地看到可以在此处标识图层。 因此,不同的层和层的配置形成不同的形状。 通常,很难看这张图并说这是ResNet-50。 我希望使用ResNet-50的另一种可视化效果,以便弄清这里发生的情况。
![Image for post](https://miro.medium.com/freeze/max/9999/0*HoZT5YOeoCeoSgie.gif)
Well, let’s go ahead and talk a bit about the visualization of the training. This is also very crucial because it has lots of interesting information like the input data images, text, the parameters, the weights, the biases, the hidden layer data, or the output data.
好吧,让我们继续讨论一下培训的可视化。 这也是非常关键的,因为它具有许多有趣的信息,例如输入数据图像,文本,参数,权重,偏差,隐藏层数据或输出数据。
![Image for post](https://miro.medium.com/max/9999/0*j9KINVMzv5Q8K7cg.jpg)
Of course, you want to track somehow what happens during the training. So, this tracking helps in particular for debugging and improving the model design. We talked about these effects already in the lecture video series about common practices.
当然,您想跟踪培训过程中发生的情况。 因此,这种跟踪特别有助于调试和改进模型设计。 我们已经在有关常规做法的讲座视频系列中讨论了这些影响。
![Image for post](https://miro.medium.com/max/9999/0*hO_L2Ht0_cz7t2PC.jpg)
So, here is a very nice visualization of training shown in the Tensorflow playground. This is a very interesting tool because here you can not just visualize the connections, but you can also visualize the activations of a 2-D input in terms of the input space. If you go back to the very first videos you see that we actually used similar representations when we were talking for example about the tree structures. So here, you can see during the training iterations, how the representations in the different layers change. They do that by a visualization of the division that is created by the respective activation function in the input space. So, you can see the first layers using fully connected layers and sigmoid activation functions. They essentially generate binary partitions of the input space. Then, you combine the layers over the layers. You see how these different partitions of the input space can then be assembled to form a more complex shape as you can see here on the right-hand side. This is typically limited to 2-D toy examples, but it’s very nice to follow the concepts and to actually understand what’s happening during the training. You can run a couple of iterations. You can accelerate, decelerate, stop the training process, and then look at what has been happening in the different steps of the training. So, this is nice.
因此,这是Tensorflow操场上显示的非常好的培训可视化。 这是一个非常有趣的工具,因为在这里您不仅可以可视化连接,而且还可以根据输入空间可视化二维输入的激活。 如果回到第一段视频,您会发现在谈论例如树结构时,我们实际上使用了类似的表示形式 。 因此,在这里,您可以看到在训练迭代期间,不同层中的表示形式是如何变化的。 它们通过可视化输入空间中各个激活函数创建的划分来实现。 因此,您可以看到使用完全连接的层和S型激活功能的第一层。 它们本质上生成输入空间的二进制分区。 然后,将图层合并到图层上。 您将看到如何将输入空间的这些不同分区组装在一起,以形成更复杂的形状,如此处右侧所示。 这通常仅限于二维玩具示例,但遵循这些概念并真正了解培训过程中发生的事情非常好。 您可以运行几个迭代。 您可以加速,减速,停止训练过程,然后查看训练的不同步骤中正在发生的事情。 所以,这很好。
![Image for post](https://miro.medium.com/max/9999/0*fiu5qdqUUAnIAZ1B.jpg)
But if you want to really look into large problems, then things like Tensorboard are really useful. Here, you can monitor the actual progress during the training. This is definitely something you should use when you train large networks. Here, you can see how the loss is behaving on the training, how is the validation loss changes, and so on. You can visualize this over the entire training and you can really use that to see if there’s convergence or to detect if there’s something wrong with your training process. If you already ran like a hundred epochs and nothing happened with your loss, or if you have an exploding gradient and stuff like that, you immediately see that in visualizations of Tensorboard.
但是,如果您真的想研究大问题,那么Tensorboard之类的东西真的很有用。 在这里,您可以监视培训期间的实际进度。 在训练大型网络时,绝对应该使用此功能。 在这里,您可以看到损失在培训中的表现方式,验证损失如何变化,等等。 您可以在整个培训中将其可视化,并且可以真正地使用它来查看是否存在收敛或检测您的培训过程是否存在问题。 如果您已经跑了一百个纪元,而损失却没有发生任何事情,或者您有爆炸性的梯度之类的东西,那么您会立即在Tensorboard的可视化中看到它。
![Image for post](https://miro.medium.com/max/9999/0*eSyPfBHSi__2ckS4.jpg)
Okay. So now, we already discussed several different visualizations, in particular of the architectures and the training process. Actually, we’ve been using this all the time. Still, I think you should be aware that the way how you visualize things. This is very important if you want to convey your ideas to other people. What we’ll talk about in the next video is actually then visualizing the inner workings of the network. So, we will look into techniques on how to figure out what’s going on inside of the network. These are actually quite interesting techniques that are also very useful for debugging and trying to understand what’s happening in your network. We will start in the first video with a short motivation and some weaknesses of deep neural networks that you should be aware of. So, thank you very much for listening and see you in the next video. Bye-bye!
好的。 因此,现在,我们已经讨论了几种不同的可视化效果,特别是体系结构和培训过程。 实际上,我们一直在使用它。 不过,我认为您应该意识到事物的可视化方式。 如果您想将自己的想法传达给其他人,这非常重要。 在下一个视频中,我们将要讨论的实际上是可视化网络的内部工作原理。 因此,我们将研究有关如何弄清楚网络内部正在发生什么的技术。 这些实际上是非常有趣的技术,对于调试和尝试了解网络中正在发生的事情也非常有用。 我们将以简短的动机和您应该意识到的深度神经网络的一些缺点从第一个视频开始。 因此,非常感谢您的收听,并在下一个视频中与您相见。 再见!
If you liked this post, you can find more essays here, more educational material on Machine Learning here, or have a look at our Deep LearningLecture. I would also appreciate a follow on YouTube, Twitter, Facebook, or LinkedIn in case you want to be informed about more essays, videos, and research in the future. This article is released under the Creative Commons 4.0 Attribution License and can be reprinted and modified if referenced. If you are interested in generating transcripts from video lectures try AutoBlog.
如果你喜欢这篇文章,你可以找到这里更多的文章 ,更多的教育材料,机器学习在这里 ,或看看我们的深入 学习 讲座 。 如果您希望将来了解更多文章,视频和研究信息,也欢迎关注YouTube , Twitter , Facebook或LinkedIn 。 本文是根据知识共享4.0署名许可发布的 ,如果引用,可以重新打印和修改。 如果您对从视频讲座中生成成绩单感兴趣,请尝试使用AutoBlog 。
链接 (Links)
Yosinski et al.: Deep Visualization ToolboxOlah et al.: Feature VisualizationAdam Harley: MNIST Demo
翻译自: https://towardsdatascience.com/visualization-attention-part-1-a16667295007
node-red 可视化