Coder Social home page Coder Social logo

hopular's Introduction

Hopular: Modern Hopfield Networks for Tabular Data

Bernhard Schäfl1, Lukas Gruber1, Angela Bitto-Nemling1, 2, Sepp Hochreiter1, 2

1 ELLIS Unit Linz and LIT AI Lab, Institute for Machine Learning, Johannes Kepler University Linz, Austria
2 Institute of Advanced Research in Artificial Intelligence (IARAI)


Detailed blog post on this paper at this link.

While Deep Learning excels in structured data as encountered in vision and natural language processing, it failed to meet its expectations on tabular data. For tabular data, Support Vector Machines (SVMs), Random Forests, and Gradient Boosting are the best performing techniques with Gradient Boosting in the lead. Recently, we saw a surge of Deep Learning methods that were tailored to tabular data but still underperformed compared to Gradient Boosting on small-sized datasets. We suggest "Hopular", a novel Deep Learning architecture for medium- and small-sized datasets, where each layer is equipped with continuous modern Hopfield networks. The modern Hopfield networks use stored data to identify feature-feature, feature-target, and sample-sample dependencies. Hopular's novelty is that every layer can directly access the original input as well as the whole training set via stored data in the Hopfield networks. Therefore, Hopular can step-wise update its current model and the resulting prediction at every layer like standard iterative learning algorithms. In experiments on small-sized tabular datasets with less than 1,000 samples, Hopular surpasses Gradient Boosting, Random Forests, SVMs, and in particular several Deep Learning methods. In experiments on medium-sized tabular data with about 10,000 samples, Hopular outperforms XGBoost, CatBoost, LightGBM and a state-of-the art Deep Learning method designed for tabular data. Thus, Hopular is a strong alternative to these methods on tabular data.

The full paper is available at: https://arxiv.org/abs/2206.00664.

Requirements

The software was developed and tested on the following 64-bit operating systems:

  • Rocky Linux 8.5 (Green Obsidian)
  • macOS 12.4 (Monterey)

As the development environment, Python 3.8.3 in combination with PyTorch Lightning 1.4.9 was used. More details on how to install PyTorch Lightning are available on the official project page.

Installation

The recommended way to install the software is to use pip/pip3:

$ pip3 install git+https://github.com/ml-jku/hopular

Usage

Hopular has two modes of operation:

  • list for displaying various information.
  • optim for optimizing Hopular using specified hyperparameters.

More information regarding the operation modes is accessible via the -h flag (or, alternatively, by --help).

$ hopular -h
$ hopular <mode> -h

To display all available datasets, the --datasets flag has to be specified in the list mode.

$ hopular list --datasets 

Optimizing a Hopular model using the default hyperparameters is achieved by specifying the corresponding dataset in the optim mode.

$ hopular optim --dataset <dataset_name>

Examples

To optimize a Hopular model on the GlassIdentificationDataset using the default hyperparameters, only the dataset name itself needs to be specified. More details on the default values are available in the console interface implementation.

$ hopular optim --dataset "GlassIdentificationDataset"

Optimizing a smaller Hopular model on the GlassIdentificationDataset utilizing only 4 modern Hopfield networks, 2 iterative refinement blocks, and a scaling factor of 10 is achieved by manually specifying the respective hyperparameters.

$ hopular optim --dataset "GlassIdentificationDataset" --num_heads 4 --num_blocks 2 --scaling_factor 10

Disclaimer

The datasets, which are part of this repository, are publicly available and may be licensed differently. Hence, the LICENSE of this repository does not apply to them. More details on the origin of the datasets are available in the accompanying paper.

License

This repository is MIT-style licensed (see LICENSE), except where noted otherwise.

hopular's People

Contributors

bschaefl 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.