Skip to content

Instantly share code, notes, and snippets.

View rsilveira79's full-sized avatar
🚗
Having fun

Roberto Silveira rsilveira79

🚗
Having fun
View GitHub Profile
@rsilveira79
rsilveira79 / reliability_diagram.py
Created August 6, 2020 16:50 — forked from gpleiss/reliability_diagram.py
Reliability diagram code
import torch
import numpy as np
from matplotlib import pyplot as plt
def make_model_diagrams(outputs, labels, n_bins=10):
"""
outputs - a torch tensor (size n x num_classes) with the outputs from the final linear layer
- NOT the softmaxes
labels - a torch tensor (size n) with the labels
"""