This project leverages quantum neural network alongside classical model to classify the images. It features the classification of CIFAR10 and MNIST dataset using a hybrid classical-quantum neural network.
To run the code, first clone the repository onto a local folder, then follow the following steps.
- Create a virtual environment inside the cloned repository
python -m venv venv
- Activate the virtual environment
source venv/bin/activate
- Install all the dependencies required (all the required packages are listed in the
setup.py
file)
pip install .
- The
cifar10
andmnist
folders have the respective models that you can train using different quantum circuits or ansatz. As an example we will be training the MNIST dataset with the1_ry_qubit
ansatz. (each ansatz is a folder in the respective dataset folder).
python mnist/1_ry_qubit/train.py
You can modify the attributes in the config.py
file while writing your training code, to change the hyperparameters or the location of your data to be save at.