Code Monkey home page Code Monkey logo

Comments (9)

wchargin avatar wchargin commented on September 7, 2024 15

I don't see what the problem is with using an actual normal log scale.

Users know whether their data is appropriate to be visualized on a log scale. If the user selects "log scale," then they know that their data is all positive.

If charts "look crazy due to extremely negative outputs," this means that you have data very close to zero. When using a linear scale, the data will look like a perfectly flat line. You get no information out of such a chart. If you use a proper log scale and see extremely negative outputs, then you are learning exactly what you wanted to about your data.

"If you have both positive and negative values in your graph," then you just shouldn't use a log scale. It's not the right tool for the job in that case. On the other hand, this pseudolinear scale that we currently use is never the right tool for the job.

I am very wary of "multiply[ing] the x input values by some value based on their magnitudes" before taking their logarithms. The goal of the chart is not to create a pretty line; it is to display the user's data. Distorting the data is obviously incorrect.

As long as TensorBoard does not crash when the plot has negative values (preferably show NaN-triangles in the graph; alternately show an error or something), it seems clear that using a log scale when the user asks for a log scale is the right way to go.

For a point of reference, open any other application that plots data: Excel, Sheets, gnuplot, pgfplots, octave, matplotlib. I guarantee you that if you select a log scale on any of them, you will get a log scale.

from tensorboard.

nealwu avatar nealwu commented on September 7, 2024 2

+1. Experiencing the exact same issue. @chihuahua @jart @dandelionmane

Here are a few screenshots to demonstrate. The only thing log scale does here is zoom in slightly.

screenshot from 2017-08-17 17 48 36
screenshot from 2017-08-17 17 48 42

from tensorboard.

nealwu avatar nealwu commented on September 7, 2024 1

I agree. I don't mean that TensorBoard should display multiplied values to the user, but that it should find some sort of workaround rather than just be incorrect when values are less than 1. Another possibility if I understand the code correctly is to set scale._pivot to the smallest value in your data, which should set it up so that all your data gets displayed correctly as log scale.

from tensorboard.

nealwu avatar nealwu commented on September 7, 2024

Just found this: palantir/plottable#3348

Have we tried the scale._pivot = 0 suggestion?

from tensorboard.

chihuahua avatar chihuahua commented on September 7, 2024

Here's where Plottable uses the _pivot property. https://github.com/palantir/plottable/blob/3a5b401d2f44b299d1c38e5a69554efefef7c77a/src/scales/modifiedLogScale.ts#L70

I'm trying to understand the motivation behind adjusting the log value in that manner. Specifically, why add a value to the log output that ranges from 1 (at x = 0) to 0 (at x = base).

from tensorboard.

chihuahua avatar chihuahua commented on September 7, 2024

Applying that solution sometimes results in good charts, but sometimes results in completely unviewable ones. See below.

log scale off:
no-log-scale

log scale on (bad examples circled):
log-scale

from tensorboard.

chihuahua avatar chihuahua commented on September 7, 2024

I think I understand the trade-offs now. log(x) goes to -infinity when x is 0, so the Plottable folks never let that happen by adding a _pivot value (that interpolates between 1 and 0 up to the base, at which log_base(base) = 1) to tiny raw inputs.

Hence, we can't just set _pivot = 0. That won't work because for many cases, charts will look crazy due to extremely negative outputs.

A solution to this issue must be more nuanced. We must multiply the x input values by some value (based on the magnitudes of the x values) before applying log.

from tensorboard.

nealwu avatar nealwu commented on September 7, 2024

I think the main issue with a fully log scale is if you have both positive and negative values in your graph. The thing is that's very rare though, and log scale wouldn't make sense for a graph with positive and negative values anyway.

What if we only enabled log scale on graphs where all of the values were positive? Should be fairly easy to get proper log scale in that case. Even if the Plottable library doesn't work on values less than 1, you can multiply all of the values by some large enough multiplier to get them all above 1 before passing them to Plottable (so if your values are 0.01, 0.02, 0.03, just pass in 1, 2, 3).

from tensorboard.

nfelt avatar nfelt commented on September 7, 2024

It was pointed out that #938 is a duplicate of this older issue. There's some valuable more recent discussion on #938 but we're centralizing on this issue for tracking purposes.

I've marked this contributions welcome, since we are stretched thin in terms of our ability to do new feature work right now. That said, I agree that this should be fixed and we would happily take a PR to replace the ModifiedLog scale with a true log scale as long as it has some reasonable provision for negative values (like the matplotlib style here: #938 (comment)).

from tensorboard.

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.