Code Monkey home page Code Monkey logo

Comments (2)

simonhessner avatar simonhessner commented on September 17, 2024 3

I have done something like that if I understand the question correctly. I am computing the variance over the heatmap to determine how confident it is:

def heatmap_variance(heatmaps):
    # copied and modified:
    # https://github.com/anibali/dsntnn/blob/4f20f5a85b56d007adef51e5158f5a6dca92794f/dsntnn/__init__.py#L233-L262

    # mu = E[X]
    values = [normalized_linspace(d, dtype=heatmaps.dtype, device=heatmaps.device)  for d in heatmaps.size()[2:]]
    mu = linear_expectation(heatmaps, values)

    # var = E[(X - mu)^2]
    values = [(a - b.squeeze(0)) ** 2 for a, b in zip(values, mu.split(1, -1))]
    var = linear_expectation(heatmaps, values)

    heatmap_size = torch.tensor(list(heatmaps.size()[2:]), dtype=var.dtype, device=var.device)

    return var * (heatmap_size / 2) ** 2

from dsntnn.

anibali avatar anibali commented on September 17, 2024

I have not done this myself, but you could try to derive a confidence score from the normalised heatmap by quantifying how "spread out" it is.

from dsntnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.