In this exercise, you will implement a binary classifier to classify a single number from the MNIST dataset. You will be required to complete the functions provided in the Python files.
- Define dense models with single and hidden layers.
- Train a model to classify a single digit from the MNIST dataset.
- Evaluate the performance of the trained model.
You are required to complete the following functions in 'layered_model.py'. Your completed functions should pass the tests provided.
define_dense_model_single_layer
: Define a dense model with a single layer.define_dense_model_with_hidden_layer
: Define a dense model with a hidden layer.fit_mnist_model_single_digit
: Train the model for a single digit classification.evaluate_mnist_model_single_digit
: Evaluate the performance of the trained model.
- After committing and pushing your code, check the mark on the top line (near the commit ID).
- If some tests are failing, click on the ❌ to open up a popup, which will show details about the errors.
- You can click the Details link to see what went wrong. Pay special attention to lines with the words "Failed" or "error".
- Near the bottom of the Details page, you can see your score. Here are examples of 0/5 and 5/5:
- When you achieve a perfect score, you will see a green checkmark near the commit ID.
- You can test your code locally by installing and running
pytest
(pip install pytest
orconda install pytest
). - Run the tests using the command
pytest
in your terminal. This will show the status of each test and any errors that occurred.
Good luck!