How satwik-kundu/dynamic-parameter-prediction works
Project type and purpose
• This is a research-oriented quantum machine learning codebase implementing “DyPP” (Dynamic Parameter Prediction) to accelerate convergence of Variational Quantum Neural Networks (QNNs) on an MNIST classification task.
• Key indicators: Python scripts for data generation (autoencoder.py), QNN building/training (qnn_torch.py), circuit modules under app/encoder, app/pqc, app/measurement, and a paper overview in the README.
File structure
Top-level:
• autoencoder.py – builds & trains a convolutional autoencoder to compress MNIST to a lower-dimensional feature set.
• qnn_torch.py – main entry point for building the QNN (using app/ modules), applying DyPP, and training on the compressed data.
• prediction.py – uses the trained DyPP model to predict QNN parameters.
• train_function.py – contains the generic training loop (used by qnn_torch.py).
• app/encoder/encoding_circuits.py – defines feature‐to‐qubit encoding circuits.
• app/pqc/parametric_circuits.py – defines parameterized quantum circuit blocks.
• app/measurement/measurement_circuits.py – defines measurement operator circuits.
• app/qnn_builder.py – orchestrates assembling encoding + PQC + measurement into a full QNN circuit.
• requirements.txt – python dependencies (e.g., PyTorch, PennyLane/qiskit, NumPy, Pandas).
• dypp-overview.pdf – project overview with schematic.
README for additional insights
• Describes the DyPP algorithm and its hyperparameters (p, d, k, dr).
a. Main components
1. Data Layer
– Raw MNIST images
– Compressed feature CSV (latent_mnist_test_d32.csv)
2. Autoencoder Module (autoencoder.py)
– Convolutional encoder/decoder pipeline
3. QNN Builder Layer (app/encoder, app/pqc, app/measurement, app/qnn_builder.py)
4. DyPP Predictor (inside qnn_torch.py)
5. Training Engine (train_function.py)
6. Inference/Prediction Module (prediction.py)
7. External Dependencies (PyTorch, PennyLane/qiskit, Pandas, NumPy)
b. Relationships & interactions
• Raw MNIST → Autoencoder → latent feature CSV
• QNN Builder reads CSV → builds circuit graph → PyTorch QNN model
• Training Engine loops: forward(input → QNN), compute loss, backprop + DyPP predictor updates parameters (at interval p)
• Prediction Module loads trained DyPP model → predicts next parameters for new circuits
• All modules share common config/hyperparameters (in qnn_torch.py)
c. Architectural patterns & principles
• Modular separation: data‐processing (autoencoder), model‐building (circuit modules), training/prediction.
• Plug-and-play circuit blocks: each circuit type (encoding, parametric, measurement) is isolated for extensibility.
• Parameter‐prediction (DyPP) is orthogonal to the training process and can be swapped in/out.
d. Key technologies/frameworks
• Python 3.x
• PyTorch (neural network training)
• PennyLane or Qiskit (quantum circuit simulation) – inferred from QNN context
• Pandas/NumPy (data handling)
Detailed elements
• Component labels matching file names or directory names.
• Hyperparameter config block (show p, d, k, dr).
• Version of Python or environment (via requirements.txt).