LLM(5) | Encoder 和 Decoder 架构
LLM(5) | Encoder 和 Decoder 架构
文章目录
- LLM(5) | Encoder 和 Decoder 架构
- 0. 目的
- 1. 概要
- 2. encoder 和 decoder 风格的 transformer (Encoder- And Decoder-Style Transformers)
- 原始的 transformer (The original transformer)
- 编码器 (Encoders)
- 解码器 (Decoders)
- 编码器和解码器的混合 (encoder-decoder hybrids)
- 术语、 黑话 (Terminology and jargon)
- 结论
- References
0. 目的
LLM 模型都是 transformer 结构的, 先前已经粗略翻阅了提出 transformer 模型的论文 “Attention Is All You Need”, 了解到了 transformer 结构是第一个完全基于 attention 的模型。
而在一些资料中, 看到有人对 LLM 进行分类, 分成 encoder-only, decoder-only, encode-decode 三类, 感觉很晕, 有必要了解下什么是 encoder 和 decoder。
本文主要是对 Understanding Encoder And Decoder LLMs 的翻译。
老规矩, 中文翻译后的括号里, 是个人粗浅的笔记和想法。
1. 概要
Several people asked me to dive a bit deeper into large language model (LLM) jargon and explain some of the more technical terms we nowadays take for granted. This includes references to “encoder-style” and “decoder-style” LLMs. What do these terms mean?
我被人问了好几次, 让我更深入的说说 LLM 术语, 并解释我们现在认为理所当然的一些更技术性的术语。 这包括对 encode-style 和 decoder-style 的 LLM。 这些术语是什么意思?
( LLM 火起来后, 经常发现一些缩写,术语, 让不了解它的人很晕。 有些老铁让作者讲讲。 作者 sebastianraschka 以前是 University of Wisconsin-Madison 的 Assistant Professor, 后来全职加入 lighting ai。)
To explain the difference between encoder- and decoder-style LLMs, I wanted to share an excerpt from my new book, Machine Learning Q and AI, that I completed last week.
为了解释 encoder-style 和 decoder-style LLM 的区别, 我想分享一段我上周完成的新书 “Machine Learning Q and AI” 的摘录。
(作者写了一本书, 看来在讲授 AI 方面有经验.)
This book is aimed at people who are already familiar with machine learning and deep learning (“AI”) and are interested in diving into more advanced topics. There are 30 chapters in total, covering various topics, including
这本书是针对那些已经熟悉机器学习和深度学习(AI), 并对深入更高级话题感兴趣的人, 总共有30章, 涵盖了各种主题,包括:
- 多GPU训练范式的解释 (Explanations of multi-GPU training paradigms)
- 微调 transformer (Finetuning transformers)
- encoder 和 decoder 风格的 LLM 之前的区别 (Differences between encoder- and decoder-style LLMs)
- 更多其他主题 (And many more!)
(看了下电子书需要购买,20+美元)
2. encoder 和 decoder 风格的 transformer (Encoder- And Decoder-Style Transformers)
Fundamentally, both encoder- and decoder-style architectures use the same self-attention layers to encode word tokens. However, the main difference is that encoders are designed to learn embeddings that can be used for various predictive modeling tasks such as classification. In contrast, decoders are designed to generate new texts, for example, answering user queries.
基本上, endoder- 和 decoder- 风格的架构, 都使用相同的 self-attention 层来编码单词标记 (word tokens). 然而, 主要区别在于 encoder 的设计,是为了学习可以用于各种预测建模任务的嵌入。 相反, decoder 的设计初衷是生成新的文本, 比如回答用户的查询。
(encoder 是为了学习一个 embedding, 这个 embedding 能用于预测性的任务比如分类; decoder 是为了生成新的文本, 比如回答问题.)
原始的 transformer (The original transformer)
The original transformer architecture (Attention Is All You Need, 2017), which was developed for English-to-French and English-to-German language translation, utilized both an encoder and a decoder, as illustrated in the figure below.
原始的 transformer 架构是在2017年的论文 “Attention Is All You Need” 里提出的, 左图是 encoder, 右图是 decoder:
In the figure above, the input text (that is, the sentences of the text that is to be translated) is first tokenized into individual word tokens, which are then encoded via an embedding layer before it enters the encoder part.
在上图中, 输入文本(即要翻译的文本的句子)首先被分词成单个词元(token), 然后通过 embedding 层进行编码, 然后进入编码器部分。
Then, after adding a positional encoding vector to each embedded word, the embeddings go through a multi-head self-attention layer.
然后, 在为每个嵌入的单词添加位置编码向量后, 嵌入 multi-head self-attention 层。
The multi-head attention layer is followed by an “Add & normalize” step, which performs a layer normalization and adds the original embeddings via a skip connection (also known as a residual or shortcut connection).
multi-head attention 层之后是 “Add & Normalize” 步骤, 它执行 layer normalization, 并通过 skip connection (也叫做残差 或 快捷连接)添加原始嵌入。
Finally, after entering a “fully connected layer,” which is a small multilayer perceptron consisting of two fully connected layers with a nonlinear activation function in between, the outputs are again added and normalized before they are passed to a multi-head self-attention layer of the decoder part.
最后, 经过进入全连接层后, 这是一个由两个全连接层组成的小型多层感知机, 在两者之间还有非线性激活函数, 输出再次被添加和归一化, 然后传递到 decoder 部分的 multi-head self-attention 层。
The decoder part in the figure above has a similar overall structure as the encoder part. The key difference is that the inputs and outputs are different.
上图中 decoder 部分和 encoder 部分具有相似的整体结构。 主要区别在于输入和输出是不同的。
The encoder receives the input text that is to be translated, and the decoder generates the translated text.
encoder 接收要翻译的输入文本, decoder 则是生成翻译后的文本。
以下是个人理解
encoder 和 decoder 没那么神秘。 提出 transformer 的那篇论文里的第一张图, 左图是 encoder, 右图是 decoder, 并且 encoder 和 decoder 在整体上是非常相似的。 为什么这么说呢? 你看:
- 【红色】 encoder 和 decoder 的输入, 都是先经过 tokenize 后搞一个 embendding 和 positional encoding 的
- 【绿色】 进入 encoder 和 decoder 里面, 都是先经过一个 MHA 的结构 (先忽略 mask 的问题)
- 【橙色】 然后是 “Add & normalize” 和 “Fully connected” 层的组合
- 【没标记颜色】 encoder 和 decoder 内部的最后一部分, 都是 “Add & normalize”
编码器 (Encoders)
The encoder part in the original transformer, illustrated in the preceding figure, is responsible for understanding and extracting the relevant information from the input text.
在原始 transformer 中,编码器部分负责理解和提取输入文本中的相关信息。
It then outputs a continuous representation (embedding) of the input text that is passed to the decoder.
然后,它输出输入文本的连续表示(embedding),这个表示被传递给 decoder。
Finally, the decoder generates the translated text (target language) based on the continuous representation received from the encoder.
最后, decoder 基于从 encoder 接收到的连续表示生成翻译文本(目标语言)。
Over the years, various encoder-only architectures have been developed based on the encoder module of the original transformer model outlined above.
多年来,基于上述原始 transformer 模型的 encoder 模块,已经开发了各种 encoder-only 的架构。
Notable examples include BERT (Pre-training of Deep Bidirectional Transformers for Language Understanding, 2018) and RoBERTa (A Robustly Optimized BERT Pretraining Approach, 2018).
值得注意的例子包括BERT(用于语言理解的深度双向变换器的预训练,2018年)和RoBERTa(一种鲁棒优化的BERT预训练方法,2018年)
BERT (Bidirectional Encoder Representations from Transformers) is an encoder-only architecture based on the Transformer’s encoder module.
BERT(来自 transformer 的双向 encoder 表示)是一种 encoder-only 的架构, 它里面的 encoder 模块是基于 transformer 的 encoder 模块。
The BERT model is pretrained on a large text corpus using masked language modeling (illustrated in the figure below) and next-sentence prediction tasks.
BERT模型使用遮蔽语言建模(完形填空)(如下图所示)和下一句预测任务在大型文本语料库上进行预训练.
The main idea behind masked language modeling is to mask (or replace) random word tokens in the input sequence and then train the model to predict the original masked tokens based on the surrounding context.
遮蔽语言建模背后的主要思想是在输入序列中遮蔽(或替换)随机词语标记,然后训练模型根据周围的上下文预测原始遮蔽的标记。
Next to the masked language modeling pretraining task illustrated in the figure above, the next-sentence prediction task asks the model to predict whether the original document’s sentence order of two randomly shuffled sentences is correct. For example, two sentences, in random order, are separated by the [SEP] token:
除了上图所示的遮蔽语言建模预训练任务之外,下一句预测任务要求模型预测两个随机打乱顺序的句子是否保持了原始文档的句子顺序。例如,两个随机顺序的句子由[SEP]标记分隔:
[CLS] Toast is a simple yet delicious food [SEP] It’s often served with butter, jam, or honey.
[CLS] 吐司是一种简单却美味的食物 [SEP] 它通常搭配黄油、果酱或蜂蜜食用。
[CLS] It’s often served with butter, jam, or honey. [SEP] Toast is a simple yet delicious food.
[CLS] 它通常搭配黄油、果酱或蜂蜜食用。[SEP] 吐司是一种简单却美味的食物。
The [CLS] token is a placeholder token for the model, prompting the model to return a True or False label indicating whether the sentences are in the correct order or not.
其中 [CLS] 标记是模型的占位符标记,提示模型返回一个真或假的标签,表明句子的顺序是否正确。
The masked language and next-sentence pretraining objectives (which are a form of self-supervised learning, as discussed in Chapter 2) allow BERT to learn rich contextual representations of the input texts, which can then be finetuned for various downstream tasks like sentiment analysis, question-answering, and named entity recognition.
遮蔽语言和下一句预训练目标(正如第二章所讨论的,这是一种自监督学习的形式)使得BERT能够学习输入文本的丰富上下文表示,然后可以针对各种下游任务进行微调,如情感分析、问答和命名实体识别。
RoBERTa (Robustly optimized BERT approach) is an optimized version of BERT. It maintains the same overall architecture as BERT but employs several training and optimization improvements, such as larger batch sizes, more training data, and eliminating the next-sentence prediction task. These changes resulted in RoBERTa achieving better performance on various natural language understanding tasks than BERT.
RoBERTa(鲁棒优化的BERT方法)是BERT的优化版本。它保持了与BERT相同的总体架构,但采用了多项训练和优化改进,如更大的批量大小、更多的训练数据,并且取消了下一句预测任务。这些变化使得RoBERTa在各种自然语言理解任务上的表现优于BERT。
解码器 (Decoders)
Coming back to the original transformer architecture outlined at the beginning of this section, the multi-head self-attention mechanism in the decoder is similar to the one in the encoder, but it is masked to prevent the model from attending to future positions, ensuring that the predictions for position i can depend only on the known outputs at positions less than i. As illustrated in the figure below, the decoder generates the output word by word.
回到本节开头概述的原始 transformer 架构, decoder 中的 multi-head self-attention 机制与 encoder 中的相似,但它被遮蔽以防止模型关注未来的位置,确保位置i的预测只能依赖于小于i的位置上已知的输出。如下图所示,decoder 逐字生成输出。
This masking (shown explicitly in the figure above, although it happens internally in the decoder’s multi-head self-attention mechanism) is essential to maintain the autoregressive property of the transformer model during training and inference.
这种遮蔽(如上图所示,尽管它在 encoder 的 MHA 中内部发生)对于在训练和推理过程中保持 transformer 的自回归特性是至关重要的。
The autoregressive property ensures that the model generates output tokens one at a time and uses previously generated tokens as context for generating the next word token.
自回归特性确保模型一次生成一个输出标记,并使用之前生成的标记作为生成下一个词标记的上下文。
Over the years, researchers have built upon the original encoder-decoder transformer architecture and developed several decoder-only models that have proven to be highly effective in various natural language processing tasks. The most notable models include the GPT family.
多年来,研究人员在原始的 encoder-decoder transformer 架构的基础上进行了发展,开发出了几种 decoder-only 模型,这些模型在各种自然语言处理任务中被证明是高度有效的。最值得注意的模型包括GPT系列。
The GPT (Generative Pre-trained Transformer) series are decoder-only models pretrained on large-scale unsupervised text data and finetuned for specific tasks such as text classification, sentiment analysis, question-answering, and summarization.
GPT(生成式预训练变换器)系列是 decoder-only 模型,它们在大规模无监督文本数据上进行预训练,并针对特定任务如文本分类、情感分析、问答和摘要生成进行微调。
The GPT models, including GPT-2, (GPT-3 Language Models are Few-Shot Learners, 2020), and the more recent GPT-4, have shown remarkable performance in various benchmarks and are currently the most popular architecture for natural language processing.
GPT模型,包括GPT-2、(GPT-3语言模型是少数次学习者,2020年)和更近期的GPT-4,在各种基准测试中展现了卓越的性能,目前是自然语言处理中最受欢迎的架构。
One of the most notable aspects of GPT models is their emergent properties.
GPT模型最引人注目的方面之一是它们的涌现属性 (emergent properties)。
Emergent properties refer to the abilities and skills that a model develops due to its next-word prediction pretraining. Even though these models were only taught to predict the next word, the pretrained models are capable of text summarization, translation, question answering, classification, and more. Furthermore, these models can perform new tasks without updating the model parameters via in-context learning, which is discussed in more detail in Chapter 18.
涌现属性指的是模型由于下一个词预测预训练而发展出的能力和技能。尽管这些模型只被教导预测下一个词,但预训练模型能够进行文本摘要、翻译、问答、分类等。此外,这些模型可以通过上下文学习在不更新模型参数的情况下执行新任务,第18章将更详细地讨论这一点。
编码器和解码器的混合 (encoder-decoder hybrids)
Next to the traditional encoder and decoder architectures, there have been advancements in the development of new encoder-decoder models that leverage the strengths of both components.
在传统的 encoder 和 decoder 架构之外,新型 encoder-decoder 模型的开发也取得了进展,这些模型利用了两个组件的优势。
These models often incorporate novel techniques, pre-training objectives, or architectural modifications to enhance their performance in various natural language processing tasks. Some notable examples of these new encoder-decoder models include
这些模型通常融入了新颖的技术、预训练目标或架构修改,以提高它们在各种自然语言处理任务中的表现。一些值得注意的新型编码器-解码器模型包括:
BART (Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension, 2019)
BART(自然语言生成、翻译和理解的序列到序列预训练的去噪,2019)
and T5 (Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer, 2019).
和T5(利用统一的文本到文本变换器探索迁移学习的极限,2019)。
Encoder-decoder models are typically used for natural language processing tasks that involve understanding input sequences and generating output sequences, often with different lengths and structures.
encoder-decoder 模型通常用于自然语言处理任务,这些任务涉及理解输入序列并生成输出序列,输出序列的长度和结构往往与输入不同。
They are particularly good at tasks where there is a complex mapping between the input and output sequences and where it is crucial to capture the relationships between the elements in both sequences. Some common use cases for encoder-decoder models include text translation and summarization.
它们在输入与输出序列之间存在复杂映射关系的任务中表现尤为出色,捕捉两个序列中元素之间的关系至关重要。 encoder-decoder 模型的一些常见用例包括文本翻译和摘要。
术语、 黑话 (Terminology and jargon)
All of these methods, encoder-only, decoder-only, and encoder-decoder models, are sequence-to-sequence models (often abbreviated as seq2seq).
所有这些方法,包括 encoder-only、 decoder-only 和 encoder-decoder 模型,都是序列到序列模型(通常缩写为seq2seq)。
Note that while we refer to BERT-style methods as encoder-only, the description encoder-only may be misleading since these methods also decode the embeddings into output tokens or text during pretraining.
请注意,虽然我们将BERT风格的方法称为 encoder-only,但“encoder-only”这一描述可能会引起误解,因为这些方法在预训练期间也会将嵌入decoding成输出 token 或文本。
In other words, both encoder-only and decoder-only architectures are “decoding.”
换句话说,encoder-only 和 decoder-only 架构都在进行“解码”。
However, the encoder-only architectures, in contrast to decoder-only and encoder-decoder architectures, are not decoding in an autoregressive fashion.
然而,与 decoder-only 和 encoder-decoder 架构不同的是,encoder-only 架构不是以自回归方式进行解码。
Autoregressive decoding refers to generating output sequences one token at a time, conditioning each token on the previously generated tokens.
自回归解码是指一次生成一个token的输出序列,每个token都依赖于之前生成的token。
Encoder-only models do not generate coherent output sequences in this manner. Instead, they focus on understanding the input text and producing task-specific outputs, such as labels or token predictions.
encoder-only 模型不以这种方式生成连贯的输出序列。相反,它们专注于理解输入文本并产生特定于任务的输出,如标签或 token 预测。
结论
In brief, encoder-style models are popular for learning embeddings used in classification tasks, encoder-decoder-style models are used in generative tasks where the output heavily relies on the input (for example, translation and summarization), and decoder-only models are used for other types of generative tasks including Q&A. Since the first transformer architecture emerged, hundreds of encoder-only, decoder-only, and encoder-decoder hybrids have been developed, as summarized in the figure below.
简而言之,encoder-style 的模型在用于分类任务的嵌入学习中很受欢迎, encoder-decoder-style 的模型被用于输出严重依赖于输入的生成性任务(例如,翻译和摘要),而 decoder-only 模型被用于包括问答在内的其他类型的生成性任务。自第一个 transformer 架构出现以来,已经开发了数百种 encoder-only, decoder-only, and encoder-decoder hybrids 的模型结构,如下图所示。
While encoder-only models gradually lost in popularity, decoder-only models like GPT exploded in popularity thanks to breakthrough in text generation via GPT-3, ChatGPT, and GPT-4. However, encoder-only models are still very useful for training predictive models based on text embeddings versus generating texts.
虽然 encoder-only 模型逐渐失去了人气,但像GPT这样的 decoder-only 模型因GPT-3、ChatGPT和GPT-4在文本生成方面的突破而爆炸性增长。然而,encoder-only 模型在基于文本嵌入的预测模型训练方面仍然非常有用,与生成文本相比。
References
- Understanding Encoder And Decoder LLMs
- LLM的3种架构:Encoder-only、Decoder-only、encode-decode
相关文章:

LLM(5) | Encoder 和 Decoder 架构
LLM(5) | Encoder 和 Decoder 架构 文章目录 LLM(5) | Encoder 和 Decoder 架构0. 目的1. 概要2. encoder 和 decoder 风格的 transformer (Encoder- And Decoder-Style Transformers)原始的 transformer (The original transformer)编码器 (Encoders)解码器 (Decoders)编码器和…...

CV | Medical-SAM-Adapter论文详解及项目实现
******************************* 👩⚕️ 医学影像相关直达👨⚕️******************************* CV | SAM在医学影像上的模型调研【20240207更新版】-CSDN博客 CV | Segment Anything论文详解及代码实现 本文主要讲解Medical-SAM-Adapter论文及项…...

C++初阶:容器(Containers)vector常用接口详解
介绍完了string类的相关内容后:C初阶:适合新手的手撕string类(模拟实现string类) 接下来进入新的篇章,容器vector介绍: 文章目录 1.vector的初步介绍2.vector的定义(constructor)3.v…...
flink写入es的参数解析
ElasticsearchSink内部使用BulkProcessor一次将一批动作(ActionRequest)发送到ES集群。在发送批量动作前,BulkProcessor先缓存,再刷新。缓存刷新的间隔,支持基于Action数量、基于Action大小、基于时间间隔3种策略。BulkProcessor支持在同一次…...

逆向工程:揭开科技神秘面纱的艺术
在当今这个科技飞速发展的时代,我们每天都在与各种电子产品、软件应用打交道。然而,你是否想过,这些看似复杂的高科技产品是如何被创造出来的?今天,我们就来探讨一下逆向工程这一神秘而又令人着迷的领域。 一、什么是…...

决策树的相关知识点
📕参考:ysu老师课件西瓜书 1.决策树的基本概念 【决策树】:决策树是一种描述对样本数据进行分类的树形结构模型,由节点和有向边组成。其中每个内部节点表示一个属性上的判断,每个分支代表一个判断结果的输出ÿ…...

【数据结构】单向链表实现 超详细
目录 一. 单链表的实现 1.准备工作及其注意事项 1.1 先创建三个文件 1.2 注意事项:帮助高效记忆和理解 2.链表的基本功能接口 2.0 创建一个 链表 2.1 链表的打印 3.链表的创建新节点接口 4.链表的节点插入功能接口 4.1 尾插接口 4.2 头插接口 4.3 指定位…...
Opencc4j 开源中文繁简体使用介绍
Opencc4j Opencc4j 支持中文繁简体转换,考虑到词组级别。 Features 特点 严格区分「一简对多繁」和「一简对多异」。 完全兼容异体字,可以实现动态替换。 严格审校一简对多繁词条,原则为「能分则不合」。 词库和函数库完全分离,…...

vue 下载二进制文件
文章目录 概要技术细节 概要 vue 下载后端返回的二进制文件流 技术细节 import axios from "axios"; const baseUrl process.env.VUE_APP_BASE_API; //downLoadPdf("/pdf/download?pdfName" res .pdf, res); export function downLoadPdf(str, fil…...

数据结构之堆排序
对于几个元素的关键字序列{K1,K2,…,Kn},当且仅当满足下列关系时称其为堆,其中 2i 和2i1应不大于n。 { K i ≤ K 2 i 1 K i ≤ K 2 i 或 { K i ≥ K 2 i 1 K i ≥ K 2 i {\huge \{}^{K_i≤K_{2i}} _{K_i≤K_{2i1}} …...

鸿蒙(HarmonyOS)项目方舟框架(ArkUI)之ScrollBar组件
鸿蒙(HarmonyOS)项目方舟框架(ArkUI)之ScrollBar组件 一、操作环境 操作系统: Windows 10 专业版、IDE:DevEco Studio 3.1、SDK:HarmonyOS 3.1 二、ScrollBar组件 鸿蒙(HarmonyOS)滚动条组件ScrollBar&…...

读论文:DiffBIR: Towards Blind Image Restoration with Generative Diffusion Prior
DiffBIR 发表于2023年的ICCV,是一种基于生成扩散先验的盲图像恢复模型。它通过两个阶段的处理来去除图像的退化,并细化图像的细节。DiffBIR 的优势在于提供高质量的图像恢复结果,并且具有灵活的参数设置,可以在保真度和质量之间进…...

基于微信小程序的新生报到系统的研究与实现,附源码
博主介绍:✌程序员徐师兄、7年大厂程序员经历。全网粉丝12w、csdn博客专家、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java技术领域和毕业项目实战✌ 🍅文末获取源码联系🍅 👇🏻 精彩专栏推荐订阅👇…...

分享一下 uniapp 打包安卓apk
首先需要安装 Java 环境,这里就不做解释了 第二步:打开 mac 终端 / cmd 命令行工具 使用keytool -genkey命令生成证书 keytool -genkey -alias testalias -keyalg RSA -keysize 2048 -validity 36500 -keystore test.keystore *testalias 是证书别名&am…...

DevOps落地笔记-21|业务价值:软件发布的最终目的
上一课时介绍如何度量软件的内部质量和外部质量。在外部质量中,我们提到用户满意度是衡量软件外部质量的关键因素。“敏捷宣言”的第一条原则规定:“我们最重要的目标,是通过持续不断的及早交付有价值的软件使用户满意”。从这一点也可以看出…...

【动态规划】【前缀和】【数学】2338. 统计理想数组的数目
作者推荐 【动态规划】【前缀和】【C算法】LCP 57. 打地鼠 本文涉及知识点 动态规划汇总 C算法:前缀和、前缀乘积、前缀异或的原理、源码及测试用例 包括课程视频 LeetCode:2338. 统计理想数组的数目 给你两个整数 n 和 maxValue ,用于描述一个 理想…...

【已解决】onnx转换为rknn置信度大于1,图像出现乱框问题解决
前言 环境介绍: 1.编译环境 Ubuntu 18.04.5 LTS 2.RKNN版本 py3.8-rknn2-1.4.0 3.单板 迅为itop-3568开发板 一、现象 采用yolov5训练并将pt转换为onnx,再将onnx采用py3.8-rknn2-1.4.0推理转换为rknn出现置信度大于1,并且图像乱框问题…...

多路服务器技术如何处理大量并发请求?
在当今的互联网时代,随着用户数量的爆炸性增长和业务规模的扩大,多路服务器技术已成为处理大量并发请求的关键手段。多路服务器技术是一种并行处理技术,它可以通过多个服务器同时处理来自不同用户的请求,从而显著提高系统的整体性…...
SpringBoot - 不加 @EnableCaching 标签也一样可以在 Redis 中存储缓存?
网上文章都是说需要在 Application 上加 EnableCaching 注解才能让缓存使用 Redis,但是测试发现不用 EnableCaching 也可以使用 Redis,是网上文章有问题吗? 现在 Application 上用了 EnableAsync,SpringBootApplication࿰…...

Linux------命令行参数
目录 前言 一、main函数的参数 二、命令行控制实现计算器 三、实现touch指令 前言 当我们在命令行输入 ls -al ,可以查看当前文件夹下所有文件的信息,还有其他的如rm,touch等指令,都可以帮我们完成相应的操作。 其实运行这些…...

智慧医疗能源事业线深度画像分析(上)
引言 医疗行业作为现代社会的关键基础设施,其能源消耗与环境影响正日益受到关注。随着全球"双碳"目标的推进和可持续发展理念的深入,智慧医疗能源事业线应运而生,致力于通过创新技术与管理方案,重构医疗领域的能源使用模式。这一事业线融合了能源管理、可持续发…...

Lombok 的 @Data 注解失效,未生成 getter/setter 方法引发的HTTP 406 错误
HTTP 状态码 406 (Not Acceptable) 和 500 (Internal Server Error) 是两类完全不同的错误,它们的含义、原因和解决方法都有显著区别。以下是详细对比: 1. HTTP 406 (Not Acceptable) 含义: 客户端请求的内容类型与服务器支持的内容类型不匹…...

相机Camera日志实例分析之二:相机Camx【专业模式开启直方图拍照】单帧流程日志详解
【关注我,后续持续新增专题博文,谢谢!!!】 上一篇我们讲了: 这一篇我们开始讲: 目录 一、场景操作步骤 二、日志基础关键字分级如下 三、场景日志如下: 一、场景操作步骤 操作步…...

Module Federation 和 Native Federation 的比较
前言 Module Federation 是 Webpack 5 引入的微前端架构方案,允许不同独立构建的应用在运行时动态共享模块。 Native Federation 是 Angular 官方基于 Module Federation 理念实现的专为 Angular 优化的微前端方案。 概念解析 Module Federation (模块联邦) Modul…...
土地利用/土地覆盖遥感解译与基于CLUE模型未来变化情景预测;从基础到高级,涵盖ArcGIS数据处理、ENVI遥感解译与CLUE模型情景模拟等
🔍 土地利用/土地覆盖数据是生态、环境和气象等诸多领域模型的关键输入参数。通过遥感影像解译技术,可以精准获取历史或当前任何一个区域的土地利用/土地覆盖情况。这些数据不仅能够用于评估区域生态环境的变化趋势,还能有效评价重大生态工程…...
关于 WASM:1. WASM 基础原理
一、WASM 简介 1.1 WebAssembly 是什么? WebAssembly(WASM) 是一种能在现代浏览器中高效运行的二进制指令格式,它不是传统的编程语言,而是一种 低级字节码格式,可由高级语言(如 C、C、Rust&am…...

【开发技术】.Net使用FFmpeg视频特定帧上绘制内容
目录 一、目的 二、解决方案 2.1 什么是FFmpeg 2.2 FFmpeg主要功能 2.3 使用Xabe.FFmpeg调用FFmpeg功能 2.4 使用 FFmpeg 的 drawbox 滤镜来绘制 ROI 三、总结 一、目的 当前市场上有很多目标检测智能识别的相关算法,当前调用一个医疗行业的AI识别算法后返回…...
DeepSeek 技术赋能无人农场协同作业:用 AI 重构农田管理 “神经网”
目录 一、引言二、DeepSeek 技术大揭秘2.1 核心架构解析2.2 关键技术剖析 三、智能农业无人农场协同作业现状3.1 发展现状概述3.2 协同作业模式介绍 四、DeepSeek 的 “农场奇妙游”4.1 数据处理与分析4.2 作物生长监测与预测4.3 病虫害防治4.4 农机协同作业调度 五、实际案例大…...

学校时钟系统,标准考场时钟系统,AI亮相2025高考,赛思时钟系统为教育公平筑起“精准防线”
2025年#高考 将在近日拉开帷幕,#AI 监考一度冲上热搜。当AI深度融入高考,#时间同步 不再是辅助功能,而是决定AI监考系统成败的“生命线”。 AI亮相2025高考,40种异常行为0.5秒精准识别 2025年高考即将拉开帷幕,江西、…...

Aspose.PDF 限制绕过方案:Java 字节码技术实战分享(仅供学习)
Aspose.PDF 限制绕过方案:Java 字节码技术实战分享(仅供学习) 一、Aspose.PDF 简介二、说明(⚠️仅供学习与研究使用)三、技术流程总览四、准备工作1. 下载 Jar 包2. Maven 项目依赖配置 五、字节码修改实现代码&#…...