Coder Social home page Coder Social logo

Regression Task Scoring about tf-keras-vis HOT 2 CLOSED

keisen avatar keisen commented on May 23, 2024
Regression Task Scoring

from tf-keras-vis.

Comments (2)

keisen avatar keisen commented on May 23, 2024

@Lswhiteh, I'm sorry for the lack of information.
InactiveScore is the function to inactivate the model output by multiplying by zero. (For example: #14)
tf-keras-vis doesn't have the score class for Regression task, so please refer to the following.

For purposes of brevity, I assume that the shape of your model's output is (samples, 1).
And, in Regression task, we need to consider how what you want to visualize contributes to the model output,
so suppose that you are interested in one (or more) of the following:

  • Increase the output value
  • Decrease the output value
  • Maintain the output value at ...

(Because you've attempted to use InactiveScore, you're probably interested in Decrease the output value, right.)

The score functions you need will be one (or more) of the following:

def score_when_increase(output):
    return output[:, 0]

def score_when_decrease(output):
    return -1.0 * output[:, 0]

def score_when_maintain(output):
    # If you want to visualize the region of input that contributes to maintain the output at 0.0
    return tf.math.abs(1.0 / (output[:, 0] + tf.keras.backend.epsilon()))

For example, if you want to visualize the region of input that contributes the increase output, the usage is:

saliency_maps = saliency(score_when_increase, X)

If you have any question or any problem, please feel free to ask us.
Thanks!

from tf-keras-vis.

Lswhiteh avatar Lswhiteh commented on May 23, 2024

This clarified quite a bit for me, thanks for the help!

from tf-keras-vis.

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.