Code Monkey home page Code Monkey logo

frnn's Introduction

Folded Recurrent Neural Networks

Here we provide the code for Folded Recurrent Neural Networks, a type of recurrent auto-encoder with shared states between encoder and decoder. This allows for representation stratification, with the resulting model requiring less capacity on the deeper layers. It is also possible to use only the encoder or decoder during encoding and prediction, respectively. This results in computational and memory savings, and limits the propagation of prediction errors by avoiding the re-encoding of predictions. Due to this strategy, layers can be removed from an already trained model. This facilitates the analysis of the contribution to the final predictions made by each layer. It also serves as mechanism for reducing the size of the final models. This code applies fRNN to future video prediction, as explained in the following paper:

https://arxiv.org/pdf/1712.00311.pdf

This repository also implements the RLadder baseline presented in the paper. This baseline uses an equivalent topology that makes use of bridge connections instead of directly sharing the states. The other methods in the comparison also made their code publicly available.

DATASETS & MODELS

The models for each dataset are saved inside "./model//". Each model has a main file, one for the fRNN model named "model_frnn.py" and one for the RLadder baseline, named "main_rladder.py". These files specify the paths where to find the pre-processed data and save the trained models, as well as the training parameters:

  • Number of training iterations (batches)
  • Batch size
  • Device to use
  • Topology parameters
  • Data loading and augmentation parameters

The folder for each dataset also contains a dataset-specific loader to feed the network ("loader.py") and a data preprocessing script ("preprocess.py"). The former should only be modified if you plan on using the code on other datasets not considered here. The later should be manually run in order to prepare the dataset before trying to train any model. In the case of Moving MMNIST, the preprocessing script will download the necessary files before preprocessing. For KTH and UCF101 the script expects the uncompressed datasets to be already present. These can be found in the following websites:

KTH - http://www.nada.kth.se/cvap/actions/
UCF101 - http://crcv.ucf.edu/data/UCF101.php

MAIN FILES

Each model has a main file associated. They are all identical, changing only the imported model file. By default, the model will train, test and analyse the results of the model. Each step can be executed independently by commenting the other actions, as intermediate results are saved to disk. There is also a "run" function commented by default. This function allows you to extract direct predictions from the model, as well as to plot the results as they are obtained.

frnn's People

Contributors

moliusimon avatar

Watchers

James Cloos 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.