Commit 890a5f31 authored by yuguo's avatar yuguo
Browse files

update

parent 012376cf
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
## 模型结构 ## 模型结构
<img src="http://developer.hpccube.com/codes/modelzoo/bert-large_oneflow/-/raw/main/bert%E6%A8%A1%E5%9E%8B%E7%BB%93%E6%9E%84.png" alt="bert模型结构.png" style="zoom:67%;" /> <img src="http://developer.hpccube.com/codes/modelzoo/bert-large_oneflow/-/raw/main/bert%E6%A8%A1%E5%9E%8B%E7%BB%93%E6%9E%84.png" alt="bert模型结构.png" style="zoom: 50%;" />
我们为了用户可以使用OneFlow-Libai快速验证Bert模型预训练,统计性能或验证精度,提供了一个Bert网络示例,主要网络参数如下: 我们为了用户可以使用OneFlow-Libai快速验证Bert模型预训练,统计性能或验证精度,提供了一个Bert网络示例,主要网络参数如下:
...@@ -25,7 +25,7 @@ model.cfg.hidden_layers = 8 ...@@ -25,7 +25,7 @@ model.cfg.hidden_layers = 8
BERT的全称为Bidirectional Encoder Representation from Transformers,是一个预训练的语言表征模型。它强调了不再像以往一样采用传统的单向语言模型或者把两个单向语言模型进行浅层拼接的方法进行预训练,而是采用新的**masked language model(MLM)**,以致能生成**深度的双向**语言表征。以往的预训练模型的结构会受到单向语言模型(*从左到右或者从右到左*)的限制,因而也限制了模型的表征能力,使其只能获取单方向的上下文信息。而BERT利用MLM进行预训练并且采用深层的双向Transformer组件(*单向的Transformer一般被称为Transformer decoder,其每一个token(符号)只会attend到目前往左的token。而双向的Transformer则被称为Transformer encoder,其每一个token会attend到所有的token*)来构建整个模型,因此最终生成**能融合左右上下文信息**的深层双向语言表征。 BERT的全称为Bidirectional Encoder Representation from Transformers,是一个预训练的语言表征模型。它强调了不再像以往一样采用传统的单向语言模型或者把两个单向语言模型进行浅层拼接的方法进行预训练,而是采用新的**masked language model(MLM)**,以致能生成**深度的双向**语言表征。以往的预训练模型的结构会受到单向语言模型(*从左到右或者从右到左*)的限制,因而也限制了模型的表征能力,使其只能获取单方向的上下文信息。而BERT利用MLM进行预训练并且采用深层的双向Transformer组件(*单向的Transformer一般被称为Transformer decoder,其每一个token(符号)只会attend到目前往左的token。而双向的Transformer则被称为Transformer encoder,其每一个token会attend到所有的token*)来构建整个模型,因此最终生成**能融合左右上下文信息**的深层双向语言表征。
<img src="http://developer.hpccube.com/codes/modelzoo/bert-large_oneflow/-/raw/main/bert%E7%AE%97%E6%B3%95%E5%8E%9F%E7%90%86.png" alt="bert算法原理.png" style="zoom:67%;" /> <img src="http://developer.hpccube.com/codes/modelzoo/bert-large_oneflow/-/raw/main/bert%E7%AE%97%E6%B3%95%E5%8E%9F%E7%90%86.png" alt="bert算法原理.png" style="zoom: 50%;" />
## 环境配置 ## 环境配置
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment