Skip to content
/ HMI Public

PyTorch implementation of Hyperbolic Embedding Inference for Structured Multi-Label Prediction (NeurIPS'22)

Notifications You must be signed in to change notification settings

xiongbo010/HMI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyTorch implementation of Hyperbolic Embedding Inference for Structured Multi-Label Prediction (NeurIPS'22)

Abstract: We consider a structured multi-label prediction problem where the labels are organized under implication and mutual exclusion constraints. A major concern is to produce predictions that are logically consistent with these constraints. To do so, we formulate this problem as an embedding inference problem where the constraints are imposed onto the embeddings of labels by geometric construction. Particularly, we consider a hyperbolic Poincaré ball model in which we encode labels as Poincaré hyperplanes that work as linear decision boundaries. The hyperplanes are interpreted as convex regions such that the logical relationships (implication and exclusion) are geometrically encoded using the insideness and disjointedness of these regions, respectively. We show theoretical groundings of the method for preserving logical relationships in the embedding space. Extensive experiments on 12 datasets show 1) significant improvements in mean average precision; 2) lower number of constraint violations; 3) an order of magnitude fewer dimensions than baselines.

Requirements

  • torch>=1.8.0
  • geoopt ($ pip install git+https://github.com/geoopt/geoopt.git)
  • numpy
  • scipy
  • pandas
  • tqdm

HEX graph example

HMI-toy-example.ipynb provides a toy example of HMI for embedding HEX graph.

Given the HEX graph (left), you will obtain the output label embeddings (right):

Hierarchy and exclusion (HEX) graph Learning hyperbolic label embeddings

Multi-label classification

To run HMI on "derisi_FUN" dataset, run the following scripts:

nohup python run.py --dataset derisi_FUN > logs/derisi_FUN.txt 2>&1 &

About

PyTorch implementation of Hyperbolic Embedding Inference for Structured Multi-Label Prediction (NeurIPS'22)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published