Home▸Data Science▸Domain-Adversarial Transfer Learning: The Gradient Reversal Layer (2D)

Simpson Paradox: Pooled Fit Versus Group Fits (2D)

Interactive 2D visualizer of a Domain-Adversarial Neural Network (DANN): a domain classifier fights a gradient reversal layer over a live labelled source cloud and shifted unlabelled target cloud in a pannable/zoomable 2D embedding-space scatter plot, with a rolling accuracy-history chart tracking domain-classifier accuracy and recovered target-task accuracy.

Data Science2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
Domain-Adversarial Transfer Learning: The Gradient Reversal Layer (2D) ↗ Open standalone

Transfer learning breaks down the moment a model's target data doesn't look like the data it was trained on — a domain shift. This simulator renders a real 3D feature-embedding space with a labelled source-domain point cloud (spheres) and a shifted, unlabelled target-domain cloud (octahedra), then runs the actual gradient-reversal-layer update from Domain-Adversarial Neural Networks (DANN) every frame: a logistic-regression domain classifier tries to tell the two clouds apart while the reversed gradient pushes both clouds toward a shared, domain-invariant representation. Live readouts track the domain classifier's accuracy (it should collapse toward chance level, 50%, as adaptation succeeds) and the target domain's task accuracy under a source-only decision boundary, so you can watch domain confusion directly translate into recovered classification accuracy — or watch it collapse the task entirely if λ is pushed too high.

⚙ Under the hood

Interactive 2D visualizer of a Domain-Adversarial Neural Network (DANN): a domain classifier fights a gradient reversal layer over a live labelled source cloud and shifted unlabelled target cloud in a pannable/zoomable 2D embedding-space scatter plot, with a rolling accuracy-history chart tracking domain-classifier accuracy and recovered target-task accuracy.

transfer learningdomain adaptationDANNgradient reversalmachine learningneural networks

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)