MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Machine Translation with Keras

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

import tensorflow.keras as keras
import numpy as np
# Define an input layer
inp = keras.layers.____(____=(____))
Edit dan Jalankan Kode