Skip to content

rasbt/ord-torchhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ordinal Regression PyTorch Hub

This is a GitHub repository containing some deep learning models for ordinal regression (with pre-trained weights) in the PyTorch Hub / Torch Hub format. Note that this repository is not going to be a comprehensive Hub for ordinal regression models but more of a way to quickly access models from a specific manuscript:

  • Xintong Shi, Wenzhi Cao, and Sebastian Raschka Deep Neural Networks for Rank-Consistent Ordinal Regression Based On Conditional Probabilities. https://arxiv.org/abs/2111.08851

(More models may be added later, but I don't want to make any promises 😅.)

PyTorch Hub / Torch Hub Resources

Using the Models

You can load the model via the following syntax:

import torch

model = torch.hub.load(
    "rasbt/ord-torchhub",
    model="resnet34_corn_afad",
    source='github',
    pretrained=True
)

Note that the pretrained versions may only perform well on images from the AFAD dataset, which is the dataset that was used to train the models. For more usage examples and transfer learning instructions, please see the examples in ./examples.

Which Models Are Currently Supported

  • "resnet34_corn_afad" (an ordinal model trained via the CORN loss)
  • "resnet34_coral_afad" (an ordinal model trained via the CORAL loss)
  • "resnet34_niu_afad" (an ordinal model trained via Niu et al.'s loss)
  • "resnet34_crossentr_afad" (a regular classifier trained via cross entropy loss)

Training (Optional)

In case you want to reproduce the model training, you can find the respective instructions and files in the _train subfolder.

App

Try an interactive App built with Lightning AI.

Link: https://bit.ly/3yHA5nk

(The source code for this App can be found under ./app.)

About

Ordinal Regression PyTorch Hub

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages