Professional Documents
Culture Documents
1- Implement an MLP network from scratch in Python, using only basic Python and NumPy:
- Use the MNIST dataset to train the network to recognize handwritten digits. The dataset
consists of 60,000 training images and 10,000 testing images, each with a size of 28x28
pixels.
- Create a 3-layer network with 784 input neurons (one for each pixel), a hidden layer with
the desired number of neurons, and 10 output neurons (one for each digit).
- Use the ReLU or tanh activation function for the hidden layer and the softmax activation
function for the output layer.
- Implement gradient descent algorithm and experiment with it with different learning
rates, batch sizes, and the number of epochs.
- Evaluate the performance of the network on the test set, and report the accuracy.
- Write the MLP in the form of class which includes forward, backward, predict, loss
calculation and … methods.
In the name of God
Computation Intelligence and its Applications in
Amirkabir University of technology Mechatronics
Electrical Engineering Department
Homework #2