Skip to main content

Revised splits for MNIST-USPS domain adaptation experiments

Project description

Splits for MNIST-USPS domain adaptation experiments

This repository contains the revised split protocol for creating splits for few shot domain adaptation on the MNIST-USPS datasets.

Contrary to often seen splits, we define an independent test split here and only let the train-val split vary according to a user-defined random seed.

Installation

pip install mnist-usps

Usage

Getting the splits is a simple as:

from mnistusps import mnistusps

train, val, test = mnistusps(
    source_name = "mnist",
    target_name = "usps",
    seed=1,
    num_source_per_class=200,
    num_target_per_class=3,
    same_to_diff_class_ratio=3,
    image_resize=(240, 240),
    group_in_out=True, # groups data: ((img_s, img_t), (lbl_s, _lbl_t))
    framework_conversion="tensorflow",
    data_path = None, # downloads to "~/data" per default
)

The function automatically downloads and unpacks the data using Torchvision internally. It then creates the splits using the Dataset Ops library. Depending on your choice of machine learning library, the dataset can be converted to Tensorflow or PyTorch (assuming either is pre-installed) using Dataset Ops.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mnistusps-0.1.0.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

mnistusps-0.1.0-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page