当前位置:网站首页>Gru of RNN
Gru of RNN
2022-07-01 07:43:00 【Programming bear】
LSTM Have longer memory ability , In most sequential tasks, we have achieved better results than the basic RNN Better performance of the model ,LSTM Gradient dispersion is not easy to occur . however LSTM The structure is relatively complex , It's expensive to calculate , The amount of model parameters is large .
One 、GRU principle
The study found that , The forgetting door is LSTM The most important gating in , It is even found that the network with only forgetting gate outperforms the standard on multiple benchmark data sets LSTM The Internet . In simplified version LSTM in , Gated loop network (Gated Recurrent Unit, abbreviation GRU) Is the most widely used RNN One of the variants . GRU Merge the internal state vector and the output vector , Unified as state vector , door The control quantity is also reduced to 2 individual : Reset door (Reset Gate) And update the door (Update Gate)
1. Reset door
The reset gate is used to control the status of the last timestamp
Get into GRU The amount of .

Gating vector
Entered by the current timestamp
and Last timestamp status
The result of change , Relationship :
. Gating vector
Control status only
, Without controlling the input
:
. When
= 0 when , New input
All from input
, Don't accept
, This is equivalent to resetting
. When
= 1 when ,
And the input
Together produce new output 
2. Update door
Update the last timestamp status of door control
And Xintu
For the new state vector
The degree of influence . Update gating vector
from
obtain .

be used for Control new input
The signal ,
be used for Control the last time status
The signal :
and
Yes
The number of updates is competing with each other 、 A state of ebb and flow . When updating the door
= 0 when ,
All from the last timestamp status
; When updating the door
= 1 when ,
All from new losses 
Two 、GRU Realization
1.GRUCell
GRUCell and SimpleRNNCell、LSTMCell Use the same , establish GRU Cell object , And circularly expand the operation on the time axis . It needs to maintain only one initialization state vector ( monolayer )
x = tf.random.normal([2, 80, 100])
# Initialize the state vector , GRU only one
h = [tf.zeros([2, 64])]
cell = layers.GRUCell(64) # newly build GRU Cell, The length of the vector is 64
# Untie in the timestamp dimension , Cycle through cell
for xt in tf.unstack(x, axis=1):
out, h = cell(xt, h)2.GRU
adopt layers.GRU Class can be easily passed through Sequential Containers can be stacked in multiple layers GRU Layer network , And do not maintain the initialization state vector
net = keras.Sequential([
layers.GRU(64, return_sequences=True),
layers.GRU(64)
])
out = net(x)
边栏推荐
- 【mysql学习笔记26】视图
- 良心安利万向轮 SolidWorks模型素材网站
- 2022 Guangdong Provincial Safety Officer a certificate third batch (main person in charge) special operation certificate examination question bank simulated examination platform operation
- 【R语言】年龄性别频数匹配 挑选样本 病例对照研究,对年龄性别进行频数匹配
- Challenges faced by operation and maintenance? Intelligent operation and maintenance management system to help you
- Basic knowledge of MATLAB
- C# 读写自定义的Config文件
- 2022 test questions and mock examinations for main principals of hazardous chemicals business units
- [MySQL learning notes 25] SQL statement optimization
- Conscience Amway universal wheel SolidWorks model material website
猜你喜欢

电脑有网络,但所有浏览器网页都打不开,是怎么回事?

kubernetes资源对象介绍及常用命令(二)

Huawei modelarts training alexnet model

Illusory and simple screen raindrop post-processing effect

Basic knowledge of MATLAB

Software testing methods and techniques - overview of basic knowledge

Understanding of Turing test and Chinese Room

【编程强训】删除公共字符(哈希映射)+组队竞赛(贪心)

2022 electrician (intermediate) recurrent training question bank and answers

base64
随机推荐
Minecraft 1.16.5模组开发(五十一) 方块实体 (Tile Entity)
[target detection] yolov5, the shoulder of target detection (detailed principle + Training Guide)
组件的自定义事件①
iNFTnews | 从《雪崩》到百度“希壤”,元宇宙30年的16件大事
【剑指offer&牛客101】中那些高频笔试,面试题——链表篇
2022 Guangdong Provincial Safety Officer a certificate third batch (main person in charge) special operation certificate examination question bank simulated examination platform operation
三极管是一项伟大的发明
Basic knowledge of MATLAB
如何让两融交易更极速
Mysql与Redis一致性解决方案
Cadence OrCAD Capture “网络名”相同,但是未连接或连接错误的解放方案之nodename的用法
Alibaba OSS postman invalid according to policy: policy condition failed: ["starts with", "key", "test/"]
软件测试方法和技术 - 基础知识概括
【mysql学习笔记28】存储函数
Subclasses call methods and properties of the parent class with the same name
熱烈祝賀五行和合酒成功掛牌
Jax's deep learning and scientific computing
How to create an exclusive vs Code theme
【微服务|openfeign】Feign的日志记录
【Flutter 问题系列第 72 篇】在 Flutter 中使用 Camera 插件拍的图片被拉伸问题的解决方案