Giter Site home page Giter Site logo

structuredensemble's Introduction

Structured Ensemble

This repository contains a PyTorch implementation of the paper:

Jary Pomponi, Simone Scardapane, Aurelio Uncini

Abstract

In this paper, we propose a novel ensembling technique for deep neural networks, which is able to drastically reduce the required memory compared to alternative approaches. In particular, we propose to extract multiple sub-networks from a single, untrained neural network by solving an end-to-end optimization task combining differentiable scaling over the original architecture, with multiple regularization terms favouring the diversity of the ensemble. Since our proposal aims to detect and extract sub-structures, we call it Structured Ensemble. On a large experimental evaluation, we show that our method can achieve higher or comparable accuracy to competing methods while requiring significantly less storage. In addition, we evaluate our ensembles in terms of predictive calibration and uncertainty, showing they compare favourably with the state-of-the-art. Finally, we draw a link with the continual learning literature, and we propose a modification of our framework to handle continuous streams of tasks with a sub-linear memory cost. We compare with a number of alternative strategies to mitigate catastrophic forgetting, highlighting advantages in terms of average accuracy and memory.

Main Dependencies

  • pytorch==1.7.1
  • python=3.8.5
  • torchvision==0.8.2
  • continual-learning==0.1.6.5
  • pyyaml==5.3.1
  • tqdm
  • dill

Experiments files

The folder './config/' contains all the yaml files used for the experiments presented in the paper.

The folders './config/optimizers' and './config/training' contain, respectively, the files which contain the optimizers and the training strategies.

The folder './config/experiments/classification' contains all the files used for the ensemble experiments, while './config/experiments/classification' contains the ones used in the CL scenarios.

Training

We have teo training files:

  • main.py: to be used only with config files from './config/experiments/classification'
  • main_cl.py: to be used only with config files from './config/experiments/cl'

Bot scripts accept any number of training files, which are processed sequentially, and also an optional flag --device [integer|cpu] that can be used to specify the device (otherwise the one present in each config file is used).

Please refer to the yaml files to understand how they can be formatted, and to the methods to understand the parameters that can be used.

If you want to use TinyImagenet you need to download and preprocess it first, using the script 'tinyimagenet_download.sh'.

Cite

Please cite our work if you find it useful:

@misc{pomponi2021structured,
      title={Structured Ensembles: an Approach to Reduce the Memory Footprint of Ensemble Methods}, 
      author={Jary Pomponi and Simone Scardapane and Aurelio Uncini},
      year={2021},
      eprint={2105.02551},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}

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.