All Projects → ck37 → coral-ordinal

ck37 / coral-ordinal

Licence: MIT license
Tensorflow Keras implementation of ordinal regression using consistent rank logits (CORAL) by Cao et al. (2019)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to coral-ordinal

coral-pytorch
CORAL and CORN implementations for ordinal regression with deep neural networks.
Stars: ✭ 80 (+53.85%)
Mutual labels:  ordinal-regression, ordinal-classification
potato-disease-classification
Potato Disease Classification - Training, Rest APIs, and Frontend to test.
Stars: ✭ 95 (+82.69%)
Mutual labels:  keras-tensorflow
Xtreme-Vision
A High Level Python Library to empower students, developers to build applications and systems enabled with computer vision capabilities.
Stars: ✭ 77 (+48.08%)
Mutual labels:  keras-tensorflow
uncertainty-wizard
Uncertainty-Wizard is a plugin on top of tensorflow.keras, allowing to easily and efficiently create uncertainty-aware deep neural networks. Also useful if you want to train multiple small models in parallel.
Stars: ✭ 39 (-25%)
Mutual labels:  keras-tensorflow
WGAN GP
Keras model and tensorflow optimization of 'improved Training of Wasserstein GANs'
Stars: ✭ 16 (-69.23%)
Mutual labels:  keras-tensorflow
GTAV-Self-driving-car
Self driving car in GTAV with Deep Learning
Stars: ✭ 15 (-71.15%)
Mutual labels:  keras-tensorflow
spacecutter
Ordinal regression models in PyTorch
Stars: ✭ 103 (+98.08%)
Mutual labels:  ordinal-regression
ECG-acquisition-classification
Single Lead ECG signal Acquisition and Arrhythmia Classification using Deep Learning
Stars: ✭ 41 (-21.15%)
Mutual labels:  keras-tensorflow
faster rcnn
An implementation of Faster R-CNN applied to vehicle detection.
Stars: ✭ 22 (-57.69%)
Mutual labels:  keras-tensorflow
dold
Deep Ordinal Regression with Label Diversity
Stars: ✭ 16 (-69.23%)
Mutual labels:  ordinal-regression
CRNN-OCR-lite
Lightweight CRNN for OCR (including handwritten text) with depthwise separable convolutions and spatial transformer module [keras+tf]
Stars: ✭ 130 (+150%)
Mutual labels:  keras-tensorflow
machine learning course
Artificial intelligence/machine learning course at UCF in Spring 2020 (Fall 2019 and Spring 2019)
Stars: ✭ 47 (-9.62%)
Mutual labels:  keras-tensorflow
Machine-Learning-Notebooks
15+ Machine/Deep Learning Projects in Ipython Notebooks
Stars: ✭ 66 (+26.92%)
Mutual labels:  keras-tensorflow
Kervolution
Kervolution implementation using TF2.0
Stars: ✭ 20 (-61.54%)
Mutual labels:  keras-tensorflow
Keras catVSdog tf estimator
Source for post "An Easy Guide to build new TensorFlow Datasets and Estimator with Keras Model"
Stars: ✭ 32 (-38.46%)
Mutual labels:  keras-tensorflow
100DaysOfMLCode
I am taking up the #100DaysOfMLCode Challenge 😎
Stars: ✭ 12 (-76.92%)
Mutual labels:  keras-tensorflow
NeuralNetworks
Implementation of a Neural Network that can detect whether a video is in-game or not
Stars: ✭ 64 (+23.08%)
Mutual labels:  keras-tensorflow
deep-blueberry
If you've always wanted to learn about deep-learning but don't know where to start, then you might have stumbled upon the right place!
Stars: ✭ 17 (-67.31%)
Mutual labels:  keras-tensorflow
ecce
ML Prediction of Bible Topics and Passages (Python / React)
Stars: ✭ 36 (-30.77%)
Mutual labels:  keras-tensorflow
Recurrent-Neural-Network-for-BitCoin-price-prediction
Recurrent Neural Network (LSTM) by using TensorFlow and Keras in Python for BitCoin price prediction
Stars: ✭ 53 (+1.92%)
Mutual labels:  keras-tensorflow

Ordinal regression in Tensorflow Keras

PyPi version PyPi downloads

Tensorflow Keras implementation of ordinal regression (aka ordinal classification) using

  • CORAL: consistent rank logits (CORAL) by Cao, Mirjalili, & Raschka (2019)

  • CORN: conditional ordinal regression for neural networks (CORN) by Shi X., Cao W., & Raschka S. (2021).

This package includes:

  • Ordinal output layers: CoralOrdinal() & CornOrdinal()
  • Ordinal loss function:s OrdinalCrossEntropy() & CornOrdinalCrossEntropy()
  • Ordinal error metric: MeanAbsoluteErrorLabels()
  • Ordinal activation functions: ordinal_softmax() & corn_ordinal_softmax()
  • Ordinal label prediction functions: cumprobs_to_label()

This is a work in progress, so please post any issues to the issue queue. The package was developed as part of the Berkeley D-Lab's hate speech measurement project and paper (Kennedy et al. 2020).

Acknowledgments: Many thanks to Sebastian Raschka for the help in porting from the PyTorch source repository.

Key pending items:

  • Function docstrings
  • Docs
  • Tests

Installation

Install the stable version via pip:

pip install coral-ordinal

Install the most recent code on GitHub via pip:

pip install git+https://github.com/ck37/coral-ordinal/

Dependencies

This package relies on Python 3.6+, Tensorflow 2.2+, and numpy.

Example

This is a quick example to show a basic model implementation. With actual data one would also want to specify the input shape.

import coral_ordinal as coral
NUM_CLASSES = 5
model = tf.keras.Sequential()
model.add(tf.keras.layers.Dense(32, activation = "relu"))
model.add(coral.CoralOrdinal(num_classes = NUM_CLASSES)) # Ordinal variable has 5 labels, 0 through 4.
model.compile(loss = coral.OrdinalCrossEntropy(),
              metrics = [coral.MeanAbsoluteErrorLabels()])

See this colab notebook for extended examples of ordinal regression with MNIST (multilayer perceptron) and Amazon reviews (universal sentence encoder).

Note that the minimum value of the ordinal variable needs to be 0. If your labeled data ranges from 1 to 5, you will need to subtract 1 so that it is scaled to be 0 to 4.

References

Cao, W., Mirjalili, V., & Raschka, S. (2019). Rank-consistent ordinal regression for neural networks. arXiv preprint arXiv:1901.07884, 6.

Shi X., Cao W., & Raschka S. (2021). Deep Neural Networks for Rank-Consistent Ordinal Regression Based On Conditional Probabilities. arXiv preprint arXiv:211108851

Kennedy, C. J., Bacon, G., Sahn, A., & von Vacano, C. (2020). Constructing interval variables via faceted Rasch measurement and multitask deep learning: a hate speech application. arXiv preprint arXiv:2009.10277.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].