当前位置:网站首页>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)
边栏推荐
- Inftnews | from "avalanche" to Baidu "xirang", 16 major events of the meta universe in 30 years
- Mysql与Redis一致性解决方案
- Are there any practical skills for operation and maintenance management
- 软件测试方法和技术 - 基础知识概括
- 2022广东省安全员A证第三批(主要负责人)特种作业证考试题库模拟考试平台操作
- C# Newtonsoft.Json中JObject的使用
- Those high-frequency written tests and interview questions in [Jianzhi offer & Niuke 101] - linked list
- Image style migration cyclegan principle
- Minecraft 1.16.5模组开发(五十一) 方块实体 (Tile Entity)
- redisson使用全解——redisson官方文档+注释(下篇)
猜你喜欢

Huawei modelarts training alexnet model

redisson使用全解——redisson官方文档+注释(中篇)

2022年茶艺师(中级)复训题库及答案

Eigen矩阵运算库快速上手

【推荐系统】美团外卖推荐场景的深度位置交互网络DPIN的突破与畅想

AUTOSAR learning record (1) – ECUM_ Init

2022年流动式起重机司机考试练习题及在线模拟考试

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

浅谈CVPR2022的几个研究热点

【Flutter 问题系列第 72 篇】在 Flutter 中使用 Camera 插件拍的图片被拉伸问题的解决方案
随机推荐
Oracle create auto increment ID
C# 读写自定义的Config文件
MySQL and redis consistency solution
kubernetes资源对象介绍及常用命令(二)
【深圳IO】精确食品称(汇编语言的一些理解)
【微服务|openfeign】Feign的日志记录
2022危险化学品经营单位主要负责人试题及模拟考试
电脑有网络,但所有浏览器网页都打不开,是怎么回事?
[MySQL learning notes27] stored procedure
【目标检测】目标检测界的扛把子YOLOv5(原理详解+修炼指南)
Eigen matrix operation Library
2022年茶艺师(中级)复训题库及答案
weback5基础配置详解
[软件] phantomjs屏幕截图
The computer has a network, but all browser pages can't be opened. What's the matter?
【R语言】两个/N个数据合并merge函数
浏览器本地存储
她就是那个「别人家的HR」|ONES 人物
组件的自定义事件②
Kickback -- find the first palindrome character in a group of characters