Giter VIP home page Giter VIP logo

hmi's Introduction

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

Identifier Python 3.8 PyTorch License: MIT

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

Run HMI-toy-example.ipynb, see the input (left) and output (right)

Hierarchy and exclusion (HEX) graph Learning hyperbolic label embeddings

Multi-label prediction

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

python run.py --dataset derisi_FUN > logs/derisi_FUN.txt

Citation

If you find this code useful, please cite the following paper:

@inproceedings{xiong22_neurips_2,
  title = {Hyperbolic Embedding Inference for Structured Multi-Label Prediction},
  author = {Xiong, Bo and Cochez, M. and Nayyeri, Mojtaba and Staab, Steffen},
  year = {2022},
  pages = {},
  booktitle = {Proceedings of the 36th Conference on Neural Information Processing Systems (NeurIPS)}
}

hmi's People

Contributors

xiongbo010 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

box-el

hmi's Issues

Clarification on Classification Loss and Availability of HMI+HLR Implementation

Dear author,

I wanted to express my appreciation for your paper, "Hyperbolic Embedding Inference for Structured Multi-Label Prediction" and the corresponding implementation you provided. As a student, I am keen to replicate the results outlined in your paper.

However, I have come across a question while reviewing the code in the run.py file, specifically regarding the HMI model. It appears that the classification loss used in the code is BCEWithLogitsLoss (found here). I noticed that this differs from the loss definition in your paper, which involves the summation of membership and non-membership. I would greatly appreciate it if you could clarify this discrepancy for me.

Additionally, a linked question, I would like to inquire if there is an implementation available for HMI+HLR. It would be immensely valuable for me.

Thank you for your time and assistance. I look forward to your response.

Kind regards

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.