zoukankan      html  css  js  c++  java
  • 【460】循环神经网络 RNN

    参考:An Introduction to Recurrent Neural Networks for Beginners

    其中每一个彩色框都是一排神经元,相当于普通 NN 的一层,例如 X0 为 input 层,然后 h0 为 hidden 层,y0 为 output 层;

    以此类推,X1...Xn 都是 input 层,h0...hn 都是 hidden 层,y1...yn 都是 output 层。

    相当于把两个神经网络合并成了一个,如下图所示:

    对于一句话来说,每个单词相当于一个 input,因此可以处理不同长度的单词输入,同时前面的输入训练可以影响后面。

    $W_{xh}$: (hidden_size, input_size)

    $x_t$: (input_size, 1)

    $W_{xh} x_t$: (hidden_size, 1)

    $W_{hh}$: (hidden_size, input_size)

    $h_{t-1}$: (hidden_size, 1)

    $W_{hh} h_{t-1}$: (hidden_size, 1)

    $b_h$: (hidden_size, 1)

    $h_t = tanh(W_{xh} x_t + W_{hh} h_{t-1} + b_h)$: (hidden_size, 1)

    $W_{hy}$: (output_size, hidden_size)

    $h_{t}$: (hidden_size, 1)

    $W_{hy} h_t$: (ouput_size, 1)

    $b_y$: (output_size, 1)

    $y_t = W_{hy} h_t + b_y$: (output_size, 1)

     

  • 相关阅读:
    COM组件
    【游戏引擎架构】入门(一)
    UNICODE字符串
    Python随笔10
    Python随笔9-函数
    Python随笔7
    Python随笔6
    Python随笔5
    Python随笔4
    Python随笔3
  • 原文地址:https://www.cnblogs.com/alex-bn-lee/p/12337545.html
Copyright © 2011-2022 走看看