• Stars
    star
    299
  • Rank 139,269 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 2 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Hopular: Modern Hopfield Networks for Tabular Data

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.

More Repositories

1

hopfield-layers

Hopfield Networks is All You Need
Python
1,660
star
2

cloob

Python
152
star
3

DeepRC

DeepRC: Immune repertoire classification with attention-based deep massive multiple instance learning
Python
112
star
4

clamp

Code for the paper Enhancing Activity Prediction Models in Drug Discovery with the Ability to Understand Human Language
Python
85
star
5

HopCPT

Conformal Prediction for Time Series with Modern Hopfield Networks
Python
67
star
6

GINNs-Geometry-informed-Neural-Networks

Jupyter Notebook
54
star
7

helm

Python
52
star
8

sars-cov-inhibitors-chemai

Large-scale ligand-based virtual screening for potential SARS-Cov-2 inhibitors using a deep neural network
52
star
9

L2M

Learning to Modulate pre-trained Models in RL (Decision Transformer, LoRA, Fine-tuning)
Python
49
star
10

rudder

RUDDER: Return Decomposition for Delayed Rewards
45
star
11

mhn-react

Modern Hopfield Network (MHN) for template relevance prediction
Jupyter Notebook
40
star
12

mc-lstm

Experiments with Mass Conserving LSTMs
Python
38
star
13

UPT

Code for the paper Universal Physics Transformers
Python
37
star
14

hyper-dti

HyperPCM: Robust task-conditioned modeling of drug-target interactions
Python
34
star
15

MIM-Refiner

A Contrastive Learning Boost from Intermediate Pre-Trained Representations
Python
34
star
16

lsc

Large-scale comparison of machine learning methods for drug target prediction on ChEMBL
C++
33
star
17

cloome

Jupyter Notebook
32
star
18

MAE-CT

Python
31
star
19

quam

Quantification of Uncertainty with Adversarial Models
Jupyter Notebook
27
star
20

DIffUCO

Python
26
star
21

hopfield-boosting

Jupyter Notebook
25
star
22

semantic-image-text-alignment

Python
24
star
23

SDLG

SDLG is an efficient method to accurately estimate aleatoric semantic uncertainty in LLMs
Jupyter Notebook
23
star
24

vnegnn

Python
22
star
25

rudder-demonstration-code

Code for demonstration example-task in RUDDER blog
Python
21
star
26

align-rudder

Code to reproduce results on toy tasks and companion blog for the paper.
Python
20
star
27

oeaw_ai_summer_school

Introduction to Machine Learning and Neural Networks, including NNs, CNNs, RNNs, AE, VAE, and GAN
19
star
28

chef

Python
15
star
29

subgd

Code for "Few-Shot Learning by Dimensionality Reduction in Gradient Space"
Jupyter Notebook
14
star
30

mgenerators-failure-modes

Shows some of the ways molecule generation and optimization can go wrong
Jupyter Notebook
14
star
31

reactive-exploration

Code for the paper "Reactive Exploration to Cope with Non-Stationarity in Lifelong Reinforcement Learning"
Python
14
star
32

MHNfs

Jupyter Notebook
13
star
33

hti-cnn

Python
11
star
34

VAG-CO

Python
11
star
35

tensorflow-layer-library

Tensorflow Layer Library (TeLL)
Python
10
star
36

bgnn

Python
9
star
37

gapnet-pl

Python
8
star
38

GNN-VPA

A Variance-Preserving Aggregation Strategy for Graph Neural Networks
Python
5
star
39

melvin

Python
4
star
40

convex-init

Code for Principled Weight Initialisation for Input-Convex Neural Networks
Python
4
star
41

PlattScaling

Python Package for Platt scaling based on the algorithm according to Lin, Lin and Weng
Python
3
star
42

TPDistance

Computation of 3D Triangle Point Distances (on a GPU)
Python
3
star
43

diverse-hits

Code accompanying our paper on diversity-based comparison of goal-directed generators
Jupyter Notebook
3
star
44

covid

Python
2
star
45

haprfn-R

R
2
star
46

LRAM

A Large Recurrent Action Model: xLSTM enables Fast Inference for Robotics Tasks
Python
1
star
47

ExCAPE

Code for DNNs in the ExCAPE-Project
Python
1
star
48

blog-post-performer

Blog post to the Performer paper including exemplary notebooks
1
star
49

ml-jku.github.io

Repository for the website of Institute for Machine Learning, Linz.
JavaScript
1
star
50

autoregressive_activity_prediction

This repo includes code for the autoregressive activity prediction for low-data drug discovery manuscript
Jupyter Notebook
1
star