{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "flsf21MK3KTd" }, "source": [ "# Quanvolution (Quantum convolution) for MNIST image classification with [TorchQuantum](https://github.com/mit-han-lab/torchquantum).\n", "
\n", "\n", "
\n", "\n", "Tutorial Author: Zirui Li, Hanrui Wang\n" ] }, { "cell_type": "markdown", "metadata": { "id": "mF5Ayfdg83rT" }, "source": [ "### Outline\n", "1. Introduction to Quanvolutional Neural Network.\n", "2. Build and train a Quanvolutional Neural Network.\n", " - a. Compare Quanvolutional Neural Network with a classic model.\n", " - b. Evaluate on real quantum computer.\n", "3. Compare multiple models with or without a trainable quanvolutional filter." ] }, { "cell_type": "markdown", "metadata": { "id": "QD-1NDsh-jTm" }, "source": [ "In this tutorial, we use `tq.QuantumDevice`, `tq.GeneralEncoder`, `tq.RandomLayer`, `tq.MeasureAll`, `tq.PauliZ` class from TrochQuantum.\n", "\n", "You can learn how to build, train and evaluate a quanvolutional filter using TorchQuantum in this tutorial." ] }, { "cell_type": "markdown", "metadata": { "id": "qJv0wED75YTq" }, "source": [ "## Introduction to Quanvolutional Neural Network.\n", "### Convolutional Neural Network\n", "Convolutional neural network is a classic neural network genre, mostly applied to anylize visual images. They are known for their convolutional layers that perform convolution. Typically the convolution operation is the Frobenius inner product of the convolution filter with the input image followed by an activation function. The convolution filter slides along the input image and generates a feature map. We can use the feature map for classification.\n", "\n", "