This lab will use Google Colaboratory, a tool that allows the execution of Python code and notably employs the use of Google Drive.
First install some important libraries needed for the program.
Once the dataset has been downloaded, upload the labelled_training_data.csv and labelled_testing_data.csv files into your drive. Once this file is present in your drive use the following code to mount your drive. This will allow the program to access the files in your google drive.
The training and testing data must now be imported and culled in order to lower the computation times of the models at training .
Before programming the classic and quantum model import these libraries and install pennylane for the quantum layers later.
Using a simple tensorflow setup, initialize the classical model
The model must not be compiled, fit, and finally evaluated using multiple metrics.
In order to create a quantum neural network a quantum node must be defined in order to create quantum layers. Below is the code to define a quantum node.
Now we can define our quantum layers using the quantum nodes and incorporate them into the neural networks architecture.
Finally the neural network needs to be compiled, fit, and then evaluated to compare its results with the classical neural network.