Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

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

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages