From da049bc55f869ac8b5a94e72ba8877d824765103 Mon Sep 17 00:00:00 2001 From: Ben Mainye Date: Fri, 13 Mar 2020 10:06:50 +0300 Subject: [PATCH] Update Chapter14 - Intro to LSTMs - Learn to Write Like Shakespeare.ipynb Add scope of `min_loss` variable to update it from the previous cell. Currently, returning a UnboundLocalError. --- ...er14 - Intro to LSTMs - Learn to Write Like Shakespeare.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/Chapter14 - Intro to LSTMs - Learn to Write Like Shakespeare.ipynb b/Chapter14 - Intro to LSTMs - Learn to Write Like Shakespeare.ipynb index 83edff0..7cf329b 100644 --- a/Chapter14 - Intro to LSTMs - Learn to Write Like Shakespeare.ipynb +++ b/Chapter14 - Intro to LSTMs - Learn to Write Like Shakespeare.ipynb @@ -599,6 +599,7 @@ " total_loss += loss.data / bptt\n", "\n", " epoch_loss = np.exp(total_loss / (batch_i+1))\n", + " global min_loss\n", " if(epoch_loss < min_loss):\n", " min_loss = epoch_loss\n", " print()\n",