Skip to content

Getting started

Examples

Currently the best place to start is the example jupyter notebooks. You can download them or run them on Google Colab.

Please open an issue on GitHub if you have any questions.

Overview

This library consists of 12 modules:

Module Description
Adapters Wrappers for training and inference steps
Containers Dictionaries for simplifying object creation
Datasets Commonly used datasets and tools for domain adaptation
Frameworks Wrappers for training/testing pipelines
Hooks Modular building blocks for domain adaptation algorithms
Inference Algorithm-specific functions used during inference
Layers Loss functions and helper layers
Meta Validators Post-processing of metrics, for hyperparameter optimization
Models Architectures used for benchmarking and in examples
Utils Various tools
Validators Metrics for determining and estimating accuracy
Weighters Functions for weighting losses

Adapters

Adapters contain an algorithm's training step and inference step. The training step is defined in the wrapped hook.

View this notebook for examples.


Containers

Containers are Python dictionaries with extra functions that simplify object creation.

View this notebook for examples.


Datasets

The datasets module consists of wrapper classes that output data in a format compatible with hooks.

It also contains some common domain-adaptation datasets like MNISTM, Office31, and OfficeHome.

View this notebook for examples.


Frameworks

This library works with plain PyTorch, but what about PyTorch frameworks like Ignite, Lightning, and Catalyst?

Of course, anything that works in PyTorch will also work in PyTorch frameworks. However, there is some setup involved, like registering event handlers in Ignite, or writing class definitions in Lightning and Catalyst.

The purpose of the frameworks module is to eliminate that setup.

Check out these notebooks for examples:


Hooks

Hooks are the building blocks of the algorithms in this library.

Check out these notebooks for examples:


Layers

The layers module contains loss functions and wrapper models. These are used in combination with hooks to create domain adaptation algorithms.


Validators

Validators compute or estimate the accuracy of a model.


Weighters

Weighters multiply losses by scalar values, and then reduce the losses to a single value on which you call .backward().

View this notebook for examples.