Deep Learning for Natural Language Processing by Palash Goyal Sumit Pandey & Karan Jain

Deep Learning for Natural Language Processing by Palash Goyal Sumit Pandey & Karan Jain

Author:Palash Goyal, Sumit Pandey & Karan Jain
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA


First, defining the RNN class:

class RNN:

# ...

def step(self, x):

# Update the Hidden state

self.h = np.tanh(np.dot(self.W_hh, self.h) + np.dot(self.U_xh, x))

# Compute the Output vector

o = np.dot(self.V_hy, self.h)

return o

The preceding pseudo code specifies the forward pass of a basic RNN. The function step is called at each time step of the RNN class. The parameters of this RNN are the three matrices ( W_hh, U_xh, V_hy ).

Following are the dimensions of each of the weight matrices from the preceding pseudo code and its equivalent entity from Figure 3-5:X t is input at time step t.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.