December 2019
Intermediate to advanced
468 pages
14h 28m
English
In this section, we'll implement a GRU cell with PyTorch 1.3.1 by following the blueprint from the Implementing LSTM section. Let's get started:
import mathimport torch
class GRUCell(torch.nn.Module): def __init__(self, input_size: int, hidden_size: int): """ :param input_size: input vector size :param hidden_size: cell state vector size """ super(GRUCell, self).__init__() self.input_size ...
Read now
Unlock full access