From 765d3bfeb39afaacd3b78219a9c3bcb516a74e5c Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 8 Jun 2026 12:36:32 +0100 Subject: [PATCH] Clarify LSTM input shape in Lab 1 PyTorch notebook --- lab1/PT_Part2_Music_Generation.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lab1/PT_Part2_Music_Generation.ipynb b/lab1/PT_Part2_Music_Generation.ipynb index e4982c27..263e1d8e 100644 --- a/lab1/PT_Part2_Music_Generation.ipynb +++ b/lab1/PT_Part2_Music_Generation.ipynb @@ -451,7 +451,8 @@ " self.embedding = nn.Embedding(vocab_size, embedding_dim)\n", "\n", " '''TODO: Layer 2: LSTM with hidden_size `hidden_size`. note: number of layers defaults to 1.\n", - " Use the nn.LSTM() module from pytorch.'''\n", + " Use the nn.LSTM() module from pytorch. Recall that get_batch returns\n", + " tensors with shape (batch_size, sequence_length).'''\n", " self.lstm = nn.LSTM('''TODO''') # TODO\n", "\n", " '''TODO: Layer 3: Linear (fully-connected) layer that transforms the LSTM output\n",