You are on page 1of 2

In the name of God

Computation Intelligence and its Applications in


Amirkabir University of technology Mechatronics
Electrical Engineering Department
Homework #2

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

2- Implement an MLP network in Python using the TensorFlow library:


- Use the CIFAR-10 dataset to train the network to recognize images of 10 different
objects. The dataset consists of 50,000 training images and 10,000 testing images, each
with a size of 32x32 pixels and three-color channels.
- Create a network with 3072 input neurons (one for each pixel and channel), the desired
number of hidden layers, and 10 output neurons (one for each object).
- Experiment with different optimization techniques, including the Adam optimizer and the
stochastic gradient descent optimizer with momentum. Try different learning rates and
batch sizes.
- Train the network using the best optimization technique and hyperparameters you
found.
- Evaluate the performance of the network on the test set, and report the accuracy.

Your submission should include the following:


§ Python code and a report that describes your implementation, including details about the
architecture of your network and the training process. This report should also include a
discussion of any challenges you encountered and how you overcame them.
§ A summary of your results, including the accuracy of your network on the test set and a
comparison with the performance of a simple baseline classifier.

You might also like