Source domain (labelled) Target domain (unlabelled)
drag to pan · scroll to zoom

Domain-Adversarial Transfer Learning: The Gradient Reversal Layer (2D)

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 2D feature-embedding space with a labelled source-domain point cloud (circles) and a shifted, unlabelled target-domain cloud (diamonds), 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. A live accuracy-history strip tracks the domain classifier's accuracy (it should collapse toward chance level, 50%, as adaptation succeeds) alongside 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. Drag the main view to pan and scroll to zoom, exactly like inspecting an embedding space in a real ML notebook.