Transformers 直观解释——不仅是如何工作,而且为什么工作得这么好 (Ketan Doshi)

news2024/12/29 8:50:56

Transformers 直观解释——不仅是如何工作,而且为什么工作得这么好

  • Transformers Explained Visually — Not Just How, but Why They Work So Well
    • How does the input sequence reach the Attention module 输入序列如何到达Attention模块
    • Each input row is a word from the sequence 每个输入行都是序列中的一个单词
    • Each word goes through a series of learnable transformations 每个单词都会经历一系列可学习的转换
    • Attention Score — Dot Product between Query and Key words 注意力分数——查询和关键词之间的点积
    • Attention Score — Dot Product between Query-Key and Value words 注意力分数——查询关键词和值词之间的点积
    • What is the role of the Query, Key, and Value words? 查询词、关键词和值词的作用是什么?
    • Dot Product tells us the similarity between words 点积告诉我们单词之间的相似度
    • How does the Transformer learn the relevance between words? Transformer 如何学习单词之间的相关性?
    • Summarizing — What makes the Transformer tick? 总结——是什么让 Transformer 运转起来?
    • Encoder Self-Attention in the Transformer Transformer 中的编码器自注意力
    • Decoder Self-Attention in the Transformer Transformer 中的解码器自注意力
    • Encoder-Decoder Attention in the Transformer Transformer 中的编码器-解码器注意力

原文链接:https://towardsdatascience.com/transformers-explained-visually-not-just-how-but-why-they-work-so-well-d840bd61a9d3

Transformers Explained Visually — Not Just How, but Why They Work So Well

Transformers 直观解释——不仅是如何工作,而且为什么工作得这么好

Transformers have taken the world of NLP by storm in the last few years. Now they are being used with success in applications beyond NLP as well.
在过去的几年里,Transformer 席卷了 NLP 世界。现在它们在 NLP 之外的应用中也得到了成功的使用。

The Transformer gets its powers because of the Attention module. And this happens because it captures the relationships between each word in a sequence with every other word.
Transformer 的强大得益于 Attention 模块。发生这种情况是因为它捕获了序列中每个单词与其他单词之间的关系。

But the all-important question is how exactly does it do that?
但最重要的问题是它到底是如何做到这一点的?

In this article, we will attempt to answer that question, and understand why it performs the calculations that it does.
在本文中,我们将尝试回答这个问题,并理解为什么它会执行这样的计算。

I have a few more articles in my series on Transformers. In those articles, we learned about the Transformer architecture and walked through their operation during training and inference, step-by-step. We also explored under the hood and understood exactly how they work in detail.
我的变形金刚系列中还有几篇文章。在这些文章中,我们了解了 Transformer 架构,并逐步了解了它们在训练和推理过程中的操作。我们还进行了底层探索,并准确了解了它们的工作原理。

Our goal is to understand not just how something works but why it works that way.
我们的目标不仅是了解某物是如何工作的,而且是了解它为何如此工作。

  1. Overview of functionality (How Transformers are used, and why they are better than RNNs. Components of the architecture, and behavior during Training and Inference)
    功能概述(Transformer 的使用方式以及为什么它们比 RNN 更好。架构的组件以及训练和推理期间的行为)
  2. How it works (Internal operation end-to-end. How data flows and what computations are performed, including matrix representations)
    它是如何工作的(端到端的内部操作。数据如何流动以及执行什么计算,包括矩阵表示)
  3. Multi-head Attention (Inner workings of the Attention module throughout the Transformer)
    多头注意力(注意力模块在整个 Transformer 中的内部运作)

And if you’re interested in NLP applications in general, I have some other articles you might like.
如果您对 NLP 应用程序感兴趣,我还有一些您可能会喜欢的其他文章。

  1. Beam Search (Algorithm commonly used by Speech-to-Text and NLP applications to enhance predictions)
    Beam Search(语音转文本和 NLP 应用程序常用来增强预测的算法)
  2. Bleu Score (Bleu Score and Word Error Rate are two essential metrics for NLP models)
    Bleu Score(Bleu Score 和 Word Error Rate 是 NLP 模型的两个基本指标)

To understand what makes the Transformer tick, we must focus on Attention. Let’s start with the input that goes into it, and then look at how it processes that input.
要了解 Transformer 的运行原理,我们必须关注注意力。让我们从进入其中的输入开始,然后看看它如何处理该输入。

How does the input sequence reach the Attention module 输入序列如何到达Attention模块

输入序列如何到达Attention模块

The Attention module is present in every Encoder in the Encoder stack, as well as every Decoder in the Decoder stack. We’ll zoom in on the Encoder attention first.
注意力模块存在于编码器堆栈中的每个编码器中,以及解码器堆栈中的每个解码器中。我们将首先放大编码器的注意力。

Attention in the Encoder (Image by Author)
编码器中的注意力(作者提供的图片)

As an example, let’s say that we’re working on an English-to-Spanish translation problem, where one sample source sequence is “The ball is blue”. The target sequence is “La bola es azul”.
举个例子,假设我们正在研究一个英语到西班牙语的翻译问题,其中一个示例源序列是“球是蓝色的”。目标序列是“La bola es azul”。

The source sequence is first passed through the Embedding and Position Encoding layer, which generates embedding vectors for each word in the sequence. The embedding is passed to the Encoder where it first reaches the Attention module.
源序列首先通过嵌入和位置编码层,该层为序列中的每个单词生成嵌入向量。嵌入被传递到编码器,首先到达注意力模块。

Within Attention, the embedded sequence is passed through three Linear layers which produce three separate matrices — known as the Query, Key, and Value. These are the three matrices that are used to compute the Attention Score.
在注意力机制中,嵌入序列通过三个线性层,产生三个独立的矩阵——称为查询、键和值。这是用于计算注意力分数的三个矩阵。

The important thing to keep in mind is that each ‘row’ of these matrices corresponds to one word in the source sequence.
要记住的重要一点是,这些矩阵的每一“行”对应于源序列中的一个单词。

The flow of the source sequence (Image by Author)
源序列的流程(作者提供的图片)

Each input row is a word from the sequence 每个输入行都是序列中的一个单词

每个输入行都是序列中的一个单词

The way we will understand what is going on with Attention, is by starting with the individual words in the source sequence, and then following their path as they make their way through the Transformer. In particular, we want to focus on what goes on inside the Attention Module.
我们理解注意力机制的方式是从源序列中的单个单词开始,然后跟随它们通过 Transformer 的路径。特别是,我们希望关注注意力模块内部发生的事情。

That will help us clearly see how each word in the source and target sequences interacts with other words in the source and target sequences.
这将帮助我们清楚地了解源序列和目标序列中的每个单词如何与源序列和目标序列中的其他单词相互作用。

So as we go through this explanation, concentrate on what operations are being performed on each word, and how each vector maps to the original input word. We do not need to worry about many of the other details such as matrix shapes, specifics of the arithmetic calculations, multiple attention heads, and so on if they are not directly relevant to where each word is going.
因此,当我们进行解释时,请重点关注对每个单词执行的操作以及每个向量如何映射到原始输入单词。我们不需要担心许多其他细节,例如矩阵形状、算术计算的细节、多个注意力头等等,如果它们与每个单词的去向不直接相关的话。

So to simplify the explanation and the visualization, let’s ignore the embedding dimension and track just the rows for each word.
因此,为了简化解释和可视化,我们忽略嵌入维度并仅跟踪每个单词的行。

The flow of each word in the source sequence (Image by Author)
源序列中每个单词的流程(作者提供的图片)

Each word goes through a series of learnable transformations 每个单词都会经历一系列可学习的转换

每个单词都会经历一系列可学习的转换

Each such row has been generated from its corresponding source word by a series of transformations — embedding, position encoding, and linear layer.
每个这样的行都是通过一系列转换(嵌入、位置编码和线性层)从其相应的源字生成的。

All of those transformations are trainable operations. This means that the weights used in those operations are not pre-decided but are learned by the model in such a way that they produce the desired output predictions.
所有这些转换都是可训练的操作。这意味着这些操作中使用的权重不是预先确定的,而是由模型学习的,从而产生所需的输出预测。

Linear and Embedding weights are learned (Image by Author)
学习线性和嵌入权重(作者提供的图片)

The key question is, how does the Transformer figure out what set of weights will give it the best results? Keep this point in the back of your mind as we will come back to it a little later.
关键问题是,Transformer 如何计算出哪一组权重能够带来最佳结果?请记住这一点,因为我们稍后会再讨论它。

Attention Score — Dot Product between Query and Key words 注意力分数——查询和关键词之间的点积

注意力分数——查询和关键词之间的点积

Attention performs several steps, but here, we will focus only on the Linear layer and the Attention Score.
注意力执行几个步骤,但在这里,我们将只关注线性层和注意力分数。

Multi-head attention (Image by Author)
多头注意力(作者提供的图片)

Attention Score calculation (Image by Author)
注意力分数计算(作者提供的图片)

As we can see from the formula, the first step within Attention is to do a matrix multiply (ie. dot product) between the Query (Q) matrix and a transpose of the Key (K) matrix. Watch what happens to each word.
从公式中我们可以看出,Attention 的第一步是在 Query (Q) 矩阵和 Key (K) 矩阵的转置之间进行矩阵乘法(即点积)。观察每个单词发生了什么。

We produce an intermediate matrix (let’s call it a ‘factor’ matrix) where each cell is a matrix multiplication between two words.
我们生成一个中间矩阵(我们称之为“因子”矩阵),其中每个单元格都是两个单词之间的矩阵乘法。

Dot Product between Query and Key matrices (Image by Author)
查询矩阵和关键矩阵之间的点积(作者提供的图片)

For instance, each column in the fourth row corresponds to a dot product between the fourth Query word with every Key word.
例如,第四行中的每一列对应于第四个查询词与每个关键字之间的点积。

Dot Product between Query and Key matrices (Image by Author)
查询矩阵和关键矩阵之间的点积(作者提供的图片)

Attention Score — Dot Product between Query-Key and Value words 注意力分数——查询关键词和值词之间的点积

注意力分数——查询关键词和值词之间的点积

The next step is a matrix multiply between this intermediate ‘factor’ matrix and the Value (V) matrix, to produce the attention score that is output by the attention module. Here we can see that the fourth row corresponds to the fourth Query word matrix multiplied with all other Key and Value words.
下一步是这个中间“因子”矩阵和值(V)矩阵之间的矩阵乘法,以产生由注意力模块输出的注意力分数。这里我们可以看到第四行对应于第四个查询词矩阵乘以所有其他关键字和值词。

Dot Product between Query-Key and Value matrices (Image by Author)
查询键和值矩阵之间的点积(作者提供的图片)

This produces the Attention Score vector (Z) that is output by the Attention Module.
这会产生由注意力模块输出的注意力分数向量 (Z)。

The way to think about the output score is that, for each word, it is the encoded value of every word from the “Value” matrix, weighted by the “factor” matrix. The factor matrix is the dot product of the Query value for that specific word with the Key value of all words.
考虑输出分数的方法是,对于每个单词,它是“值”矩阵中每个单词的编码值,并由“因子”矩阵加权。因子矩阵是该特定单词的查询值与所有单词的关键字值的点积。

Attention Score is a weighted sum of the Value words (Image by Author)
注意力分数是价值词的加权总和(作者提供的图片)

What is the role of the Query, Key, and Value words? 查询词、关键词和值词的作用是什么?

查询词、关键词和值词的作用是什么?

The Query word can be interpreted as the word for which we are calculating Attention. The Key and Value word is the word to which we are paying attention ie. how relevant is that word to the Query word.
查询词可以解释为我们正在计算注意力的词。键和值词是我们正在关注的词,即。该词与查询词的相关程度如何。

Attention Score for the word “blue” pays attention to every other word (Image by Author)
“蓝色”一词的注意力分数会关注所有其他单词(图片由作者提供)

For example, for the sentence, “The ball is blue”, the row for the word “blue” will contain the attention scores for “blue” with every other word. Here, “blue” is the Query word, and the other words are the “Key/Value”.
例如,对于句子“The ball is blue”,单词“blue”的行将包含“blue”与其他每个单词的注意力分数。这里,“blue”是查询词,其他词是“Key/Value”。

There are other operations being performed such as a division and a softmax, but we can ignore them in this article. They just change the numeric values in the matrices but don’t affect the position of each word row in the matrix. Nor do they involve any inter-word interactions.
还有其他操作正在执行,例如除法和 softmax,但我们可以在本文中忽略它们。它们只是更改矩阵中的数值,但不影响矩阵中每个单词行的位置。它们也不涉及任何词间交互。

Dot Product tells us the similarity between words 点积告诉我们单词之间的相似度

点积告诉我们单词之间的相似度

So we have seen that the Attention Score is capturing some interaction between a particular word, and every other word in the sentence, by doing a dot product, and then adding them up. But how does the matrix multiply help the Transformer determine the relevance between two words?
因此,我们已经看到,注意力分数通过进行点积,然后将它们相加,捕获特定单词与句子中每个其他单词之间的交互。但是矩阵乘法如何帮助 Transformer 确定两个单词之间的相关性呢?

To understand this, remember that the Query, Key, and Value rows are actually vectors with an Embedding dimension. Let’s zoom in on how the matrix multiplication between those vectors is calculated.
要理解这一点,请记住查询、键和值行实际上是具有嵌入维度的向量。让我们仔细看看这些向量之间的矩阵乘法是如何计算的。

Each cell is a dot product between two word vectors (Image by Author)
每个单元格都是两个词向量之间的点积(作者提供的图片)

When we do a dot product between two vectors, we multiply pairs of numbers and then sum them up.
当我们在两个向量之间进行点积时,我们将数字对相乘,然后将它们相加。

  • If the two paired numbers (eg. ‘a’ and ‘d’ above) are both positive or both negative, then the product will be positive. The product will increase the final summation.
    如果两个配对数字(例如上面的“a”和“d”)均为正数或均为负数,则乘积将为正数。该乘积将增加最终的总和。
  • If one number is positive and the other negative, then the product will be negative. The product will reduce the final summation.
    如果一个数为正数,另一个数为负数,则乘积将为负数。该乘积将减少最终的总和。
  • If the product is positive, the larger the two numbers, the more they contribute to the final summation.
    如果乘积为正,则两个数字越大,对最终求和的贡献就越大。

This means that if the signs of the corresponding numbers in the two vectors are aligned, the final sum will be larger.
这意味着如果两个向量中对应数字的符号对齐,则最终的和会更大。

How does the Transformer learn the relevance between words? Transformer 如何学习单词之间的相关性?

Transformer 如何学习单词之间的相关性?

This notion of the Dot Product applies to the attention score as well. If the vectors for two words are more aligned, the attention score will be higher.
点积的概念也适用于注意力分数。如果两个单词的向量更加对齐,则注意力分数会更高。

So what is the behavior we want for the Transformer?
那么我们想要 Transformer 的行为是什么?

We want the attention score to be high for two words that are relevant to each other in the sentence. And we want the score to be low for two words that are unrelated to one another.
我们希望句子中彼此相关的两个单词的注意力分数较高。我们希望两个彼此不相关的单词的分数较低。

For example, for the sentence, “The black cat drank the milk”, the word “milk” is very relevant to “drank”, perhaps slightly less relevant to “cat”, and irrelevant to “black”. We want “milk” and “drank” to produce a high attention score, for “milk” and “cat” to produce a slightly lower score, and for “milk” and “black”, to produce a negligible score.
例如,对于句子“黑猫喝牛奶”,“牛奶”一词与“喝”非常相关,可能与“猫”相关性稍差,与“黑”无关。我们希望“牛奶”和“饮料”产生较高的注意力分数,“牛奶”和“猫”产生稍低的分数,而“牛奶”和“黑色”产生可忽略不计的分数。

This is the output we want the model to learn to produce.
这是我们希望模型学习产生的输出。

For this to happen, the word vectors for “milk” and “drank” must be aligned. The vectors for “milk” and “cat” will diverge somewhat. And they will be quite different for “milk” and “black”.
为此,“牛奶”和“饮料”的词向量必须对齐。 “牛奶”和“猫”的向量会有所不同。对于“牛奶”和“黑色”来说,它们会有很大不同。

Let’s go back to the point we had kept at the back of our minds — how does the Transformer figure out what set of weights will give it the best results?
让我们回到我们一直牢记的一点——Transformer 如何计算出哪一组权重将给它带来最好的结果?

The word vectors are generated based on the word embeddings and the weights of the Linear layers. Therefore the Transformer can learn those embeddings, Linear weights, and so on to produce the word vectors as required above.
词向量是根据词嵌入和线性层的权重生成的。因此,Transformer 可以学习这些嵌入、线性权重等,以生成上述所需的词向量。

In other words, it will learn those embeddings and weights in such a way that if two words in a sentence are relevant to each other, then their word vectors will be aligned. And hence produce a higher attention score. For words that are not relevant to each other, the word vectors will not be aligned and will produce a lower attention score.
换句话说,它将以这样的方式学习这些嵌入和权重:如果句子中的两个单词彼此相关,那么它们的单词向量将对齐。从而产生更高的注意力分数。对于彼此不相关的单词,单词向量将不会对齐,并且会产生较低的注意力分数。

Therefore the embeddings for “milk” and “drank” will be very aligned and produce a high attention score. They will diverge somewhat for “milk” and “cat” to produce a slightly lower score and will be quite different for “milk” and “black”, to produce a low score.
因此,“牛奶”和“饮料”的嵌入将非常一致,并产生很高的注意力分数。对于“牛奶”和“猫”,它们会有所不同,产生稍低的分数;而对于“牛奶”和“黑色”,它们会有很大不同,产生较低的分数。

This then is the principle behind the Attention module.
这就是注意力模块背后的原理。

Summarizing — What makes the Transformer tick? 总结——是什么让 Transformer 运转起来?

总结——是什么让 Transformer 运转起来?

The dot product between the Query and Key computes the relevance between each pair of words. This relevance is then used as a “factor” to compute a weighted sum of all the Value words. That weighted sum is output as the Attention Score.
查询和密钥之间的点积计算每对单词之间的相关性。然后将该相关性用作“因子”来计算所有值词的加权和。该加权和作为注意力分数输出。

The Transformer learns embeddings etc, in such a way that words that are relevant to one another are more aligned.
Transformer 学习嵌入等,从而使彼此相关的单词更加对齐。

This is one reason for introducing the three Linear layers and making three versions of the input sequence, for the Query, Key, and Value. That gives the Attention module some more parameters that it is able to learn to tune the creation of the word vectors.
这是引入三个线性层并为查询、键和值创建三个版本的输入序列的原因之一。这为注意力模块提供了更多参数,它可以学习这些参数来调整词向量的创建。

Encoder Self-Attention in the Transformer Transformer 中的编码器自注意力

Transformer 中的编码器自注意力

Attention is used in the Transformer in three places:
Transformer 中使用了 Attention 在三个地方:

  • Self-attention in the Encoder — the source sequence pays attention to itself
    编码器中的自注意力——源序列关注自身
  • Self-attention in the Decoder — the target sequence pays attention to itself
    解码器中的自注意力——目标序列关注自身
  • Encoder-Decoder-attention in the Decoder — the target sequence pays attention to the source sequence
    Decoder 中的 Encoder-Decoder-attention — 目标序列关注源序列

Attention in the Transformer (Image by Author)
Transformer 中的注意力(作者提供的图片)

In the Encoder Self Attention, we compute the relevance of each word in the source sentence to each other word in the source sentence. This happens in all the Encoders in the stack.
在编码器自注意力中,我们计算源句子中每个单词与源句子中每个其他单词的相关性。这种情况发生在堆栈中的所有编码器中。

Decoder Self-Attention in the Transformer Transformer 中的解码器自注意力

Transformer 中的解码器自注意力

Most of what we’ve just seen in the Encoder Self Attention applies to Attention in the Decoder as well, with a few small but significant differences.
我们刚刚在编码器自注意力中看到的大部分内容也适用于解码器中的注意力,但有一些微小但显着的差异。

Attention in the Decoder (Image by Author)
解码器中的注意力(作者提供的图片)

In the Decoder Self Attention, we compute the relevance of each word in the target sentence to each other word in the target sentence.
在解码器自注意力中,我们计算目标句子中每个单词与目标句子中每个其他单词的相关性。

Decoder Self Attention (Image by Author)
解码器自注意力(作者提供的图片)

Encoder-Decoder Attention in the Transformer Transformer 中的编码器-解码器注意力

Transformer 中的编码器-解码器注意力

In the Encoder-Decoder Attention, the Query is obtained from the target sentence and the Key/Value from the source sentence. Thus it computes the relevance of each word in the target sentence to each word in the source sentence.
在Encoder-Decoder Attention中,Query是从目标句子中获取的,Key/Value是从源句子中获取的。因此,它计算目标句子中每个单词与源句子中每个单词的相关性。

Encoder-Decoder Attention (Image by Author)
编码器-解码器注意力(作者提供的图片)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1521864.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

条件队列大法好:wait和notify的基本语义

条件队列是我们常用的轻量级同步机制,也被称为“waitnotify”机制。但很多刚刚接触并发的朋友可能会对wait和notify的语义和配合过程感到迷惑。 今天从join()方法的实现切入,重点讲解wait()方法的语义,简略提及notify()与notifyAll()的语义&…

ubuntu安装docker的详细教程

检查卸载老版本docker ubuntu下自带了docker的库,不需要添加新的源。 但是ubuntu自带的docker版本太低,需要先卸载旧的再安装新的。 注:docker的旧版本不一定被称为docker,docker.io 或 docker-engine也有可能,所以卸载的命令为: sudo apt-get remove -y docker docke…

记录工作中莫名其妙的bug

1、问题:办公室的电脑突然除了我之外,都不能访问我们的线上系统了 原因:因为是内网,同事有刚刚升级了Windows11,配置的DNS被清了,还有同事换了公司的新电脑,还没有配DNS 位于:C /Win…

JVM虚拟机:通过jconsole远程连接解决JVM报错

本文重点 前面我们介绍过的一些工具都是使用命令行的方式来帮助我们完成,本文我们将使用一种图形化界面的方式来远程连接,然后完成关于JVM的检测任务。 jconsole jconsole是一个JVM的检测工具,这个工具任何安装了Java的电脑上都有的&#…

亚信安慧AntDB:简化开发与运维

AntDB将SQL作为唯一语法,不仅简化了开发运维,更提高了数据库的易用性。这种统一的语法规范让开发人员在编写和优化复杂的查询时更加得心应手,极大地提高了工作效率。随着数据库系统的不断发展,AntDB的独特设计理念使得用户可以更加…

三连杆滑块机构运动学仿真 | 【Matlab源码+理论公式文本】

【程序简介】💻🔍 本程序通过matlab实现了三连杆滑块机构的运动学仿真编程,动态展现了三连杆机构的运动动画,同时给出了角位移、角速度和角加速度的时程曲线,除了程序本身,还提供了机构运动学公式推导文档…

Centos7安装Clickhouse单节点部署

🎈 作者:互联网-小啊宇 🎈 简介: CSDN 运维领域创作者、阿里云专家博主。目前从事 Kubernetes运维相关工作,擅长Linux系统运维、开源监控软件维护、Kubernetes容器技术、CI/CD持续集成、自动化运维、开源软件部署维护…

【力扣白嫖日记】1934.确认率

前言 练习sql语句,所有题目来自于力扣(https://leetcode.cn/problemset/database/)的免费数据库练习题。 今日题目: 1934.确认率 表:Signups 列名类型user_idinttime_stampdatetime User_id是该表的主键。每一行都…

线性回归 quickstart

构建一元一次方程 100个(X, y ),大概是’y3x4’ import numpy as npnp.random.seed(42) # to make this code example reproducible m 100 # number of instances X 2 * np.random.rand(m, 1) # column vector y 4 3 * X np.random…

4.10.CVAT——3D对象标注

文章目录 1. 创建任务2. 3D 任务工作区3.标准 3D 模式 Standard 3D mode4. 用长方体进行注释4.1. 用shapes进行注释4.2. 使用长方体进行跟踪Tracking 使用 3D 注释工具来标记 3D 对象和场景,例如车辆、建筑物、景观等。 1. 创建任务 要创建 3D 任务,您必…

PS学习-抠图-蒙版-冰块酒杯等透明物体

选中图,ctrlA 全选 ctrlC复制 创建一个蒙版图层 选中蒙版Alt 点击进入 ctrlv 复制 ctrli 反转 原图层 ctrldelete填充为白色 添加一个背景,这个方法通用 首选创建一个 拖到最底部 给它填充颜色 这个可能是我图片的原因。视频是这样做的

《古滇传说水龙吟》敖诀扮演者李亚云

2024年2月28日,演员李亚云参演新剧古滇传说原创系列剧第一部《水龙吟》在浙江横店影视城开机拍摄。该剧由中共昆明市西山区委宣传部、石林县委宣传部、昆明滇池国家旅游度假区管委会文旅投促局、云南民族电影制片厂、云南卫视、昆明影视拍摄服务中心支持&#xff0c…

8:00面试,8:06就出来了,问的问题有点变态。。。

从小厂出来,没想到在另一家公司又寄了。 到这家公司开始上班,加班是每天必不可少的,看在钱给的比较多的份上,就不太计较了。没想到9月一纸通知,所有人不准加班,加班费不仅没有了,薪资还要降40%…

BMP280 arduino调试

终于成功了。 #include <SPI.h> //定义数据类型 #define s32_t long signed int #define u32_t long unsigned int #define u16_t unsigned short #define s16_t signed short // 定义从设备选择引脚 const int chipSelectPin 10; //定义BMP280寄存器/// unsigned int …

Java面向对象案例之描述专业和学生(4)

类的方法图 学生类&#xff1a; 属性&#xff1a;学号&#xff0c;姓名&#xff0c;年龄&#xff0c;所学习的专业方法&#xff1a;学习的方法&#xff0c;描述学习状态。描述内容包括姓名、学号、年龄、所学习的专业信息 专业类&#xff1a; 属性&#xff1a;专业编号&#xf…

【Poi-tl Documentation】自定义行删除标签

前置说明&#xff1a; <dependency><groupId>com.deepoove</groupId><artifactId>poi-tl</artifactId><version>1.12.1</version> </dependency>模板样式&#xff1a; 删除行表格测试.docx 实现思路&#xff1a;通过定制占位…

监视和内存观察

监视和内存观察 5.监视和内存观察5.1 监视5.2 内存 5.监视和内存观察 在调试的过程中我们&#xff0c;如果要观察代码执行过程中&#xff0c;上下文环境中的变量的值&#xff0c;有哪些方法呢&#xff1f; 这些观察的前提条件一定是开始调试后观察&#xff0c;比如&#xff1…

【深度学习模型移植】用torch普通算子组合替代torch.einsum方法

首先不得不佩服大模型的强大之处&#xff0c;在算法移植过程中遇到einsum算子在ONNX中不支持&#xff0c;因此需要使用普通算子替代。参考TensorRT - 使用torch普通算子组合替代torch.einsum爱因斯坦求和约定算子的一般性方法。可以写出简单的替换方法&#xff0c;但是该方法会…

AI健身教练-引体向上-俯卧撑计数-仰卧起坐姿态估计-康复训练姿态识别-姿态矫正

在AI健身应用中&#xff0c;通过关键点检测技术可以实现对用户动作的精准捕捉和分析&#xff0c;从而进行统计计数和规范性姿态识别。 统计计数&#xff1a;比如在做瑜伽、健身操等运动时&#xff0c;系统可以通过对人体关键点&#xff08;如手部、脚部、关节等&#xff09;的…

MySQL语法分类 DQL(4)聚合函数

为了更好的学习这里给出基本表数据用于查询操作 create table student (id int, name varchar(20), age int, sex varchar(5),address varchar(100),math int,english int );insert into student (id,name,age,sex,address,math,english) values (1,马云,55,男,杭州,66,78),…