Interpretation of Predictions

Open In Colab

Classes to build objects to better interpret predictions of a model

  1. /usr/local/lib/python3.8/dist-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
  2. return torch._C._cuda_getDeviceCount() > 0

class Interpretation[source]

Interpretation(dl, inputs, preds, targs, decoded, losses)

Interpretation base class, can be inherited for task specific Interpretation classes

  1. learn = synth_learner()
  2. interp = Interpretation.from_learner(learn)
  3. x,y = learn.dls.valid_ds.tensors
  4. test_eq(interp.inputs, x)
  5. test_eq(interp.targs, y)
  6. out = learn.model.a * x + learn.model.b
  7. test_eq(interp.preds, out)
  8. test_eq(interp.losses, (out-y)[:,0]**2)

class ClassificationInterpretation[source]

ClassificationInterpretation(dl, inputs, preds, targs, decoded, losses) :: Interpretation

Interpretation methods for classification models.

class SegmentationInterpretation[source]

SegmentationInterpretation(dl, inputs, preds, targs, decoded, losses) :: Interpretation

Interpretation methods for segmentation models.


Company logo

©2021 fast.ai. All rights reserved.
Site last generated: Mar 31, 2021