# Architecture of RNN

The below image shows an RNN being unfolded to a full network, $$x\_t$$is input to the network at time t, $$h\_t$$is the hidden state at time t also referred to as the memory of the network. It is calculated based on previous hidden state and current input.

Represented by $$h\_t= f(Ux\_t + Wh\_t +b\_h)$$

![RNN Architecture](https://885410418-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5eOOadDHYUcaYCn5CS%2F-M5eaNGC_vnkZdm-CCQV%2F-M5eb8d8xnqyMZmN3D9L%2FRNN.png?alt=media\&token=097f8922-ef65-4890-a618-eba19dc3e4cb)

Here U and W are weights for input and previous state value input respectively, $$b\_h$$is the bias associated to the hidden network and f is the non-linearity applied to the sum to generate final cell state.

And output at time t is calculated as shown below :

$$O\_t = f(Wh\_t + b\_o)$$&#x20;

$$b\_o$$ is the bias for the output layer

Now, having understood about the maths behind the architecture of an RNN , lets see how to train the network.
