-
Implementing a Custom `nn.Module` for a Gated Recurrent Unit (GRU)
Implement a **custom GRU cell** as a subclass of `torch.nn.Module`. Your implementation should handle the reset gate, update gate, and the new hidden state computation from scratch, using...
-
Implementing a Simple Attention Mechanism
Implement a **simple attention mechanism** for a sequence-to-sequence model. Given a sequence of encoder outputs and a single decoder hidden state, your attention module should compute attention...
1