This project implements and evaluates multilayer perceptrons (MLPs) from scratch using Python and NumPy. It includes code for training on toy datasets such as XOR, as well as comparison with a log-linear model.
- Python 3.x
- NumPy
You can install the dependencies using:
pip install -r requirements.txt
To train the MLP on provided data:
python train_mlp1.py
To compare with the log-linear model:
python train_loglin.py
To test MLP learning on XOR:
python xor_data.py
python train_mlp1.py --data xor
Ensure your gradients are implemented correctly:
python grad_check.py
Model predictions are saved in test.pred
. You can evaluate using provided scripts or compare with ground truth labels in the test
folder.
- All models are implemented from scratch using NumPy, with no deep learning frameworks used.