Learn practical skills, build real-world projects, and advance your career

Vanilla RNNs, GRUs and the scan function

In this notebook, you will learn how to define the forward method for vanilla RNNs and GRUs. Additionally, you will see how to define and use the function scan to compute forward propagation for RNNs.

By completing this notebook, you will:

  • Be able to define the forward method for vanilla RNNs and GRUs
  • Be able to define the scan function to perform forward propagation for RNNs
  • Understand how forward propagation is implemented for RNNs.
import numpy as np
from numpy import random
from time import perf_counter

An implementation of the sigmoid function is provided below so you can use it in this notebook.

def sigmoid(x): # Sigmoid function
    return 1.0 / (1.0 + np.exp(-x))