Giter Site home page Giter Site logo

slow-representation-learning's Introduction

Slow Representation Learning

This repository contains the code for the experiments conducted in the paper Autoencoding slow representations for semi-supervised data-efficient regression.

Requirements

This repository requires a custom dataloader for hdf5 datasets. Check out the parallel dataloader repository. The parallel dataloader is able to quickly load and cycle large image datasets through the memory of a GPU or CPU. Note: there is also a minimal example in the folder ./minimal_example with the MNIST dataset that shows how to use the basic VAE tools in this repository without the need for the above dataloader.

Datasets

The datasets used can be obtained from google drive:

Usage

An experiment setup for a specific dataset is defined in a folder. In the following example I will us the included ball example defined in the experiment folder ./blob. A setup must contain the following specifications:

  • ./blob/vaeconfig.py: This file contains hyperparameters that all experiments share such as dataset parameters, learning rates and settings for the training.
  • ./blob/network/network.py: contains the VAE architecture. The basic architecture is from this beta-VAE pytorch implementation and has been adjusted to fit the different datasets.
  • ./blob/network/ds_Network.py: contains the network architecture for the downstream task.
  • ./blob/network/train_functions.py: contains data preprocessing functions, specific loss function settings, housekeeping functions and functions to visualise the dataset.

An example to run an experiment for each dataset with one of the hyperparameter configurations used in the paper experiments is given in the file ./test.sh

The results are stored in ./blob/models/. Following this setup one can easily setup experiments with other datasets by editing the ./experiment/vaeconfig.py and the VAE architecture, data-preprocessing and downstream network architectures in ./experiment/network. The dataset has to be in hdf5 format. More details can be found in the parallel dataloader repository

Loading models

In this repository a model is more than just a torch module. Models are derived from a custom model class ./utils/model.py. This class has many additional functions such as model loading/saving, hyperparameter storage, houskeeping storage and visualisation. Thus loading a model loads the entire pickled model class containing all the housekeeping data and model weights such that the model weights and results can be accessed easily.

Other notes

Minimal example

The minimal example in ./minimal_example is a simplified version of the experiment setup if you just want to use one of the methods compared in the paper or want to check the implementations of the loss functions. It consists of a basic VAE setup without the need for a custom dataloader or a custom model class. It uses the MNIST dataset as an example and has no real experimental meaning beyond demonstration purpose as the dataset is not sequential.

Loss functions

The general loss functions S-VAE, Slow-VAE, beta-VAE and L1/L2 loss are specified in ./network/train_functions_global.py and used in the experiment specific loss functions.

slow-representation-learning's People

Contributors

oleffa avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.