Source-linked AI summary

Pylearn2: a machine learning research library

Ian J. Goodfellow, David Warde-Farley, Pascal Lamblin, Vincent Dumoulin, Mehdi Mirza, Razvan Pascanu, James Bergstra, Frédéric Bastien, Yoshua Bengio

arXiv:1308.4214v1stat.MLcs.LGcs.MS

TL;DR

Machine learning research needs libraries that can support new or unusual ideas while remaining precisely configurable. Pylearn2 addresses this through a modular, symbolic architecture and a research-oriented development philosophy, and the project grew into an active external community. Its design assumes technically sophisticated users and prioritizes flexibility over broad ease of use.

  • Problem

    Existing machine learning libraries did not provide the flexibility and extensibility required for LISA’s research needs and unusual research ideas.

  • Method

    Pylearn2 uses reusable Dataset, Model, and TrainingAlgorithm components, with symbolic Theano expressions supporting modular learning systems and CPU/GPU functionality.

  • Results

    Pylearn2 developed into a library used beyond LISA, supported by benchmark and contest visibility, Kaggle adoption, and an active contributor community.

  • Takeaways & Limitations

    Pylearn2’s research-oriented design makes precise experimentation and new feature development central goals, even when users need substantial technical expertise.

  • Takeaways & Limitations

    The design explicitly assumes technically sophisticated research users, so basic data analysis may require understanding how the algorithm works.

Abstract

from arXiv · show

Pylearn2 is a machine learning research library. This does not just mean that it is a collection of machine learning algorithms that share a common API; it means that it has been designed for flexibility and extensibility in order to facilitate research projects that involve new or unusual use cases. In this paper we give a brief history of the library, an overview of its basic philosophy, a summary of the library's architecture, and a description of how the Pylearn2 community functions socially.

1 Introduction

Pylearn2 is a research-oriented machine learning library designed for flexibility and extensibility, prioritizing precise experiment configuration over ease of use for non-experts. The paper introduces its history, philosophy, architecture, and community workflow, alongside links to documentation and user support.

  • Design goals: Pylearn2 targets machine learning researchers and is designed to make nearly any research idea feasible to implement.Its emphasis on precise configuration can require users to understand the underlying algorithms.
  • Paper scope: The paper surveys Pylearn2’s history, design philosophy, architecture, and development workflow.
  • Community resources: The project provides documentation and a user mailing list as community resources.
  • Community resources: Table 1 lists other Pylearn2 resources.

2 History

Pylearn2 emerged from LISA’s earlier library efforts after existing public libraries failed to meet its research requirements. Its external user base grew after contest success, benchmark results, and Kaggle adoption, alongside substantial community participation.

  • Origins: Pylearn2 was created after LISA determined that no existing public machine learning library met the requirements of its research.It followed PLearn and Pylearn and began implementation as a class project in early 2011.
  • Adoption: Its outside-LISA user base grew significantly in early 2013 following computer vision benchmark results and Pylearn2-formatted Kaggle baselines.Earlier interest also followed its success in a 2011 transfer learning contest.
  • Community: Over 250 GitHub users watched the repository, nearly 200 joined the mailing list, over 100 created forks, and over 30 contributed.

3 License and citation information

Pylearn2 is distributed under a three-clause BSD license that permits commercial use. Citation is encouraged for published research using the library, but the license does not require it.

  • License: The three-clause BSD license permits commercial use of Pylearn2.
  • Citation: The license does not require citation, although the paper encourages researchers to cite the article when publishing work using Pylearn2.

4 Philosophy

Pylearn2’s philosophy treats researchers as technically sophisticated users and emphasizes modularity, extensibility, and compact experiment specification. These principles favor precise, reusable research workflows over extensive restrictions or advance planning.

  • Research users: Pylearn2 assumes research users may have technical sophistication and should not face many restrictions on what the library can do.
  • Modularity: Reusable components can be combined or used independently, so users need not learn the entire library to use one part.
  • Extensibility: The project limits planning to what is needed for modular, extensible designs, avoiding paralysis and over-engineering.
  • Experiment specification: A YAML-based domain-specific language compactly specifies experiment hyperparameters and can instantiate complex experiments without implementation-specific detail.The format is intended to help researchers reproduce experiments using other software.

5 Library overview

Pylearn2 is built from components that primarily provide symbolic expressions rather than directly executing numerical code. Built on Theano, this design supports both CPU and GPU functionality from a single class.

  • Pylearn2 components can be combined into complete learning algorithms while most provide symbolic expressions instead of executing numerical code.

5.1 Core components

Pylearn2’s architecture decomposes learning systems into reusable, modular components, especially Datasets, Models, and TrainingAlgorithms. This separation supports code reuse and lets users work with only the framework parts they need.

  • Datasets provide training data, Models store parameters and generate Theano expressions, and TrainingAlgorithms adapt Models to Datasets.
  • Pylearn2 separates model expression construction from training, unlike libraries where Models generally perform most of the training work.
  • Users can implement a train_batch method while using DefaultTrainingAlgorithm only to provide batches, or bypass TrainingAlgorithms and pass a Dataset directly to a Model’s training method.
  • Shipped components aim to be modular and orthogonal, commonly reusing existing TrainingAlgorithms and Costs for learning functionality.

5.2 The Dataset class

Pylearn2 Datasets provide a common interface between arbitrary data sources and in-memory arrays while allowing multiple data views, storage strategies, preprocessing, and dataset wrappers.

  • Datasets translate arbitrary data sources into the in-memory array formats expected by Pylearn2 through a shared interface.
  • A minibatch of 64 RGB images can be represented as either a 64 × 3072 design matrix or a 64 × 32 × 32 × 3 tensor, with axis choices adapted to software requirements.
  • Dense design-matrix datasets can often be added by subclassing DenseDesignMatrix and loading data, or by using existing NumPy or pickle data without new Python code.
  • DenseDesignMatrixPyTables supports dense datasets too large for memory when stored in HDF5 format on disk.
  • Most Datasets support preprocessing that modifies data after loading.
  • Pylearn2 includes wrappers for datasets such as CIFAR-10, CIFAR-100, MNIST, NORB, Street View House Numbers, Toronto Faces, and UCI datasets.

5.3 The Model class

Pylearn2 Models store parameters and expose interfaces for computing quantities through symbolic Theano expressions. Its linear-operator abstractions support multiple transformations and convolutional implementations while preserving reusable model functionality.

  • A Model stores parameters, while subclasses define interfaces for quantities the Model can compute.
  • An MLP’s fprop method can map symbolic inputs x to a symbolic output representing p(y | x) when its final layer is a softmax.
  • The Model class need not know how to train itself, although individual Models may implement training.
  • Pylearn2’s reusable linear-operator class separates shared functionality from implementations for dense multiplication, convolution, tiled convolution, and local connections.
  • Spaces represent different formats or views required by linear operators, such as vector representations for dense multiplication and spatial formats for image convolution.
  • Wrappers add Theano semantics to fast cuda-convnet implementations for several linear operators and spatial max pooling.
  • Pylearn2 primarily contains deep learning models, including autoencoders, RBMs, DBMs, MLPs, convolutional networks, and local coordinate coding.
  • The library also includes LISA-developed models such as denoising and contractive autoencoders, spike-and-slab RBMs, and deep sparse rectifier nets.

5.4 The TrainingAlgorithm class

Pylearn2 separates model adaptation from reusable cost representations, allowing training algorithms to support exact or approximate optimization and common constraints. Its main training algorithms cover default minibatch updates, stochastic gradient descent, and batch gradient descent.

  • Core role: TrainingAlgorithm adapts a Model to a Dataset and also configures monitoring for values recorded during training.It gathers Theano expressions assembled by the Model and other components before numerical computation.
  • Constraints: Many TrainingAlgorithms project updates back into an allowed region to support constraints such as parameter nonnegativity and neural-network weight max norms.The Model supplies the projection defining the allowed region.
  • Cost representation: Cost represents a cost function independently of the algorithm used to minimize it, while optionally adding relevant monitoring channels.For example, negative log likelihood can automatically track classifier misclassification rate.
  • Gradient flexibility: Approximate-gradient costs can use the same optimization machinery as exact-gradient costs, so persistent contrastive divergence needs no special optimization class.The cost’s get_gradients method may return a sampling-based approximation, which standard SGD can optimize.
  • Implemented costs: Implemented costs span methods including dropout, contrastive divergence, noise contrastive estimation, score matching, and neural-network likelihoods.SumOfCosts combines primary costs with secondary regularizers such as weight decay or sparsity regularization.
  • Implemented algorithms: Pylearn2 includes DefaultTrainingAlgorithm, SGD, and BGD, with SGD supporting Polyak averaging, momentum, and early stopping.DefaultTrainingAlgorithm serves minibatches to a Model’s default rule, while BGD performs batch gradient descent using large minibatches in practice.

6 Development workflow and user community

Pylearn2 serves both researchers using existing implementations and researchers developing new algorithms. Development can remain private or occur through a contribution workflow centered on planning, forks, pull requests, and tests.

  • Users: Researchers can use Pylearn2 without becoming developers, including to study existing algorithms or obtain baseline results on new tasks.The library’s reference implementations support experiments under varied conditions.
  • Private and external development: Researchers may develop experimental features privately in an offline repository or distribute Pylearn2 classes through a third-party repository.These routes do not require merging the work into the main Pylearn2 repository.
  • Contribution workflow: Contributors should first discuss feature plans with pylearn-dev@googlegroups.com, follow API best practices when needed, then work in a fork and submit a pull request.The process is designed to keep the library stable.
  • Contribution workflow: Accepted contribution types include tested new features, configuration files for important results, bug fixes, and tests for existing features.

7 Conclusion

The paper presents Pylearn2’s history, design philosophy and goals, architecture, and developer workflow. It closes by inviting researchers to use the library and contribute to it.

  • The paper covers Pylearn2’s history, design philosophy and goals, basic architecture, and developer workflow.
  • The authors welcome researchers’ use of Pylearn2 and potential contributions to the library.
Loading 1308.4214v1…