The classic DANN paper, ported to PyTorch 1.0
It reproduces the foundational DANN paper in PyTorch so you can adapt an MNIST classifier to noisy MNIST-M without writing the adversarial domain-alignment boilerplate yourself.

What it does
This repo is a straightforward PyTorch reimplementation of the Unsupervised Domain Adaptation by Backpropagation paper—better known as DANN. It trains a feature extractor, label predictor, and domain classifier in an adversarial loop to nudge a model learned on MNIST toward the visually noisier MNIST-M target domain. The code follows the paper’s original architecture.
The interesting bit
The value here is archival fidelity, not novelty: you get a minimal, readable reference implementation of a foundational domain-adaptation architecture. If you want to see how adversarial domain alignment works without wading through a full framework, this is a compact sandbox.
Key highlights
- Faithful PyTorch 1.0 implementation of the original DANN paper
- Demonstrates the standard MNIST → MNIST-M synthetic-to-real shift
- README includes an architecture diagram showing the network structure
- Author maintains a separate Python 3 / Docker fork for modern environments
Caveats
- Requires manual dataset download from Baidu Drive or Google Drive before training
- Locked to PyTorch 1.0 and Python 2.7, both well past end-of-life
- README omits accuracy numbers, training curves, or comparisons to published results
Verdict
Worth a look if you need a concise, working reference for the original DANN architecture. Look elsewhere if you want a modern, batteries-included toolkit or state-of-the-art domain-adaptation methods.
Frequently asked
- What is fungtion/DANN?
- It reproduces the foundational DANN paper in PyTorch so you can adapt an MNIST classifier to noisy MNIST-M without writing the adversarial domain-alignment boilerplate yourself.
- Is DANN open source?
- Yes — fungtion/DANN is open source, released under the MIT license.
- What language is DANN written in?
- fungtion/DANN is primarily written in Python.
- How popular is DANN?
- fungtion/DANN has 951 stars on GitHub.
- Where can I find DANN?
- fungtion/DANN is on GitHub at https://github.com/fungtion/DANN.