C1W2 Assignment
C1W2 Assignment
October 1, 2022
1
data_path = os.path.join(current_dir, "data/mnist.npz")
2
[24]: # GRADED FUNCTION: train_mnist
def train_mnist(x_train, y_train):
return history
Call the train_mnist passing in the appropiate parameters to get the training history:
[25]: hist = train_mnist(x_train, y_train)
Epoch 1/10
1862/1875 [============================>.] - ETA: 0s - loss: 0.1999 - accuracy:
0.9414
Reached 99% accuracy so cancelling training!
3
[26]: # WE STRONGLY RECOMMEND YOU TO TRY YOUR OWN ARCHITECTURES FIRST
# AND ONLY RUN THIS CELL IF YOU WISH TO SEE AN ANSWER
import base64
encoded_answer =␣
,→"CiAgIC0gQSBGbGF0dGVuIGxheWVyIHRoYXQgcmVjZWl2ZXMgaW5wdXRzIHdpdGggdGhlIHNhbWUgc2hhcGUgYXMgdGh
encoded_answer = encoded_answer.encode('ascii')
answer = base64.b64decode(encoded_answer)
answer = answer.decode('ascii')
print(answer)
- A Flatten layer that receives inputs with the same shape as the images
- A Dense layer with 512 units and ReLU activation function
- A Dense layer with 10 units and softmax activation function