Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab2, 1.4 Fix confusing naming logits->predictions #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lab2/Part1_MNIST.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@
" # GradientTape to record differentiation operations\n",
" with tf.GradientTape() as tape:\n",
" #'''TODO: feed the images into the model and obtain the predictions'''\n",
" logits = # TODO\n",
" predictions = # TODO\n",
"\n",
" #'''TODO: compute the categorical cross entropy loss\n",
" loss_value = tf.keras.backend.sparse_categorical_crossentropy('''TODO''', '''TODO''') # TODO\n",
Expand Down Expand Up @@ -699,4 +699,4 @@
]
}
]
}
}
8 changes: 4 additions & 4 deletions lab2/solutions/Part1_MNIST_Solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -685,11 +685,11 @@
" # GradientTape to record differentiation operations\n",
" with tf.GradientTape() as tape:\n",
" #'''TODO: feed the images into the model and obtain the predictions'''\n",
" logits = cnn_model(images)\n",
" # logits = # TODO\n",
" predictions = cnn_model(images)\n",
" # predictions = # TODO\n",
"\n",
" #'''TODO: compute the categorical cross entropy loss\n",
" loss_value = tf.keras.backend.sparse_categorical_crossentropy(labels, logits)\n",
" loss_value = tf.keras.backend.sparse_categorical_crossentropy(labels, predictions)\n",
" # loss_value = tf.keras.backend.sparse_categorical_crossentropy('''TODO''', '''TODO''') # TODO\n",
"\n",
" loss_history.append(loss_value.numpy().mean()) # append the loss to the loss_history record\n",
Expand All @@ -716,4 +716,4 @@
]
}
]
}
}