Skip to content

Unofficial TensorFlow implementation of "Deep Gamblers" (NeurIPS 2019). Deep gamblers achieves strong results in selective classification problem without almost no modification to model architecture.

License

Notifications You must be signed in to change notification settings

josutk/deep-gamblers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Gamblers

Tensorflow implementation of Deep Gamblers.

Installation

$ pip install git+https://github.com/simaki/deep-gamblers

How to use

Example: MNIST classification with abstention

import tensorflow as tf
from deep_gamblers import coverage, GamblerLoss

x_tr, y_tr = ...  # Fetch MNIST

model = tf.models.Sequential([
    Conv2D(10, 4, activation="relu"),
    Conv2D(10, 4, activation="relu"),
    Conv2D(10, 4, activation="relu"),
    Conv2D(10, 4, activation="relu"),
    Flatten(),
    Dense(10 + 1, activation="relu"),
])

model.compile(optimizer="adam", loss=GamblerLoss(6.0), metrics=[coverage, "accuracy"])
model.fit(x_tr, y_tr, epochs=10)

About

Unofficial TensorFlow implementation of "Deep Gamblers" (NeurIPS 2019). Deep gamblers achieves strong results in selective classification problem without almost no modification to model architecture.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages