joshuacwnewton / d-SNE-PyTorch

A PyTorch port of the existing MXNet implementation for the 2019 CVPR paper "d-SNE: Domain Adaptation Using Stochastic Neighborhood Embedding."
7 stars 3 forks source link
d-sne deep-learning domain-adaptation machine-learning mxnet neural-network pytorch t-sne

d-SNE PyTorch

This is a PyTorch implementation of d-SNE: Domain Adaptation using Stochastic Neighbourhood Embedding (Xu et al., 2019). d-SNE is an algorithm for training convolutional neural networks. Specifically, the algorithm is designed for 'domain adaptation', a problem domain related to transfer learning. The authors of the publication originally implemented the algorithm using the MXNet (Gluon) deep learning framework.

Note: There are two MXNet implementations:

  1. October 2019, a version originally created for the publication's CVPR submission.
  2. March 2020, a refactored version created by the primary author in response to GitHub issues (1, 2) that suggested that the October 2019 implementation was not functional.

This port is primarily based off of the March 2020 implementation. It was created by Joshua Newton to fulfill the requirements of the course project for CSC 586B: Deep Learning for Computer Vision taught at the University of Victoria in BC, Canada.

Setup

Prior to running this app, some initial setup is required. The experiments used in this port require training/testing datasets to be downloaded manually to the /dsne_pytorch/data_loading/data directory, then repacked into HDF5 containers.

Please refer to the README.md file in dsne_pytorch/data_loading for further instructions on how to download and repack the required datasets.

Usage

At time of writing, only the MNIST -> MNIST-M (supervised, 10 target images per class) experiment has been replicated. Please ensure that the necessary datasets have been prepared before continuing. To run this experiment, use the following command:

python3 -m dsne_pytorch configs/mt-mm.cfg --train --test

To tweak this experiment, please review the mt-mm.cfg file in dsne_pytorch/configs for available configuration options. Each configuration parameter can also be overridden using additional CLI arguments, such as:

python3 -m dsne_pytorch configs/mt-mm.cfg --train --test --batch_size 100 --learning_rate 0.0001

Future work

Below is a list of the remaining functionality described by the source publication that has yet to be implemented.

Below is a list of experiments described by the source publication which have which have yet to be replicated.

Lastly, it could be beneficial to further explore hyperparameter tuning. The default set of hyperparameters provided with the March 2020 MXNet implementation appear to have significant flaws.

If time permits, this repository will be updated with further progress.

Resources used in this project

Below are attributions for guides, tutorials, templates, and miscellaneous repositories that were consulted when implementing this project.