Gated Recurrent Unit (GRU)
Gated Recurrent Unit (GRU)
Outline
Background
GRU Network
GRU vs. LSTM
Experiment
References
Background
A gated recurrent unit (GRU) was proposed by Cho et al. [2014] to make each recurrent unit to adaptively capture dependencies of different time scales.
Solving problems existed in RNN: Gradient Vanishing.
Example:
GRU Network
GRU vs. LSTM
Code Example:
import tensorflow as tf
x = tf.constant([[1]], dtype = tf.float32)
…
state0_lstm = lstm_cell.zero_state(1,dtype=tf.float32)
output,state = lstm_cell(x,state0_lstm)
state0_gru = gru_cell.zero_state(1,dtype=tf.float32)
output2,state2 = gru_cell(x,state0_gru)
with tf.Session() as sess:
sess.run(init)
print(sess.run(output))
print(sess.run(state))
print(sess.run(output2))
print(sess.run(state2))
Experiment
References
1. Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling
2. Learned-norm pooling for deep feedforward and recurrent neural networks
3. Long short-term memory
<script>
(function(){
function setArticleH(btnReadmore,posi){
var winH = $(window).height();
var articleBox = $("div.article_content");
var artH = articleBox.height();
if(artH > winH*posi){
articleBox.css({
'height':winH*posi+'px',
'overflow':'hidden'
})
btnReadmore.click(function(){
articleBox.removeAttr("style");
$(this).parent().remove();
})
}else{
btnReadmore.parent().remove();
}
}
var btnReadmore = $("#btn-readmore");
if(btnReadmore.length>0){
if(currentUserName){
setArticleH(btnReadmore,3);
}else{
setArticleH(btnReadmore,1.2);
}
}
})()
</script>
</article>
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET 原生驾驭 AI 新基建实战系列:向量数据库的应用与畅想
· 从问题排查到源码分析:ActiveMQ消费端频繁日志刷屏的秘密
· 一次Java后端服务间歇性响应慢的问题排查记录
· dotnet 源代码生成器分析器入门
· ASP.NET Core 模型验证消息的本地化新姿势
· ThreeJs-16智慧城市项目(重磅以及未来发展ai)
· .NET 原生驾驭 AI 新基建实战系列(一):向量数据库的应用与畅想
· Ai满嘴顺口溜,想考研?浪费我几个小时
· Browser-use 详细介绍&使用文档
· 软件产品开发中常见的10个问题及处理方法