Aan de slagGa gratis aan de slag

Part 1: Understanding GRU models

Did you know these models can remember even up to thousands of time steps compared to standard recurrent neural networks which can usually remember less than hundred time steps only. Understanding GRU models is essential to use them effectively to implement machine translation models.

In this exercise, you will implement a simple model that has an input layer and a GRU layer. You will then use the model to produce output values for a random input array.

Don't be discouraged that you are using random data. The objective of this exercise is to understand the shape of the outputs produced by the GRU layer. In later chapters, you will feed in actual sentences to GRU layers to perform translation.

Deze oefening maakt deel uit van de cursus

Machine Translation with Keras

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

import tensorflow.keras as keras
import numpy as np
# Define an input layer
inp = keras.layers.____(____=(____))
Code bewerken en uitvoeren