Skip to content

[ADD]: protype with Classifier, encoder, model, problem_embedding, tr…#6

Merged
SachaHenneveux merged 1 commit intomainfrom
feat/prototype-v1
Feb 3, 2026
Merged

[ADD]: protype with Classifier, encoder, model, problem_embedding, tr…#6
SachaHenneveux merged 1 commit intomainfrom
feat/prototype-v1

Conversation

@divisio74
Copy link
Collaborator

…ansformers + testscripte

Description

This PR introduces Prototype v1 of the GNN + Transformer architecture for solving graph optimization problems (MaxCut, Vertex Cover, Independent Set, Graph Coloring).

Architecture Overview

Graph → GNN Encoder → E_local, E_global
Problem ID → Lookup Table → E_prob
Concat [E_global || E_local || E_prob] → Transformer → Classifier → Cross-Entropy

Components

File Role
encoder.py GNN (GAT) that produces node embeddings and graph embedding
problem_embedding.py Learnable lookup table that converts problem ID to vector
transformer.py Concatenates embeddings + self-attention between nodes
classifier.py Multi-class classifier with Cross-Entropy loss
model.py Complete QuantumGraphModel assembling all components
test_model.py Full test suite (8/8 tests passing)

Key Features

  • Unified architecture for multiple problem types (binary and multi-class)
  • Cross-Entropy loss enables both 2-class (MaxCut) and k-class (Graph Coloring) problems
  • Backpropagation updates all components including the problem embedding lookup table
  • Variable graph sizes supported (tested with 4, 8, 16, 32 nodes)
  • 3.3M parameters total

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the needed labels
  • I have linked this PR to an issue
  • I have linked this PR to a milestone
  • I have linked this PR to a project
  • I have tested this code
  • I have added / updated tests (unit / functional / end-to-end / ...)
  • I have updated the README and other relevant documents (guides...)
  • I have added sufficient documentation both in code, as well as in the READMEs

Additional comments

This is a clean prototype implementation based on team research discussions. Next steps:

  • DataLoader for training data
  • Training loop implementation
  • Evaluation metrics

@SachaHenneveux SachaHenneveux self-requested a review February 3, 2026 18:36
@SachaHenneveux SachaHenneveux merged commit c932ff7 into main Feb 3, 2026
1 check passed
@SachaHenneveux SachaHenneveux deleted the feat/prototype-v1 branch February 3, 2026 18:43
@SachaHenneveux SachaHenneveux restored the feat/prototype-v1 branch February 3, 2026 18:43
@SachaHenneveux SachaHenneveux deleted the feat/prototype-v1 branch February 3, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants