Skip to content

Conversation

@jameswex
Copy link
Contributor

@jameswex jameswex commented Jun 25, 2019

  • Motivation for features / changes

Models with many classes (like 100) have display issues in WIT

  • Technical description of changes

Only show top N classes in PD plots, just like we already do in inference panel
Correctly scroll large confusion matrices instead of overflowing into area where it can't be viewed

  • Screenshots of UI changes
    100conf

100pdp

  • Detailed steps to verify changes work correctly (as executed by you)

Ran all demos to see no regressions
Ran a demo with 100 classes to verify better visuals

@jameswex
Copy link
Contributor Author

@tolga-b please review

Copy link
Contributor

@tolga-b tolga-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. In future we probably want to change the visualization of confusion matrix to make it more understandable with that many classes.

@jameswex jameswex requested a review from stephanwlee June 25, 2019 16:50
@jameswex
Copy link
Contributor Author

Agreed Tolga. This PR just makes it no longer break the tool. But it could be improved with a more significant confusion matrix change.

@stephanwlee please review

this.selected.length > 0 ? this.selected[0] : 0;
// Get the class labels of the top scoring classes from the most
// recent inference.
const labels = this.examplesAndInferences[exampleId].inferences[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah, this is a bit hard to read and parse. How about something like

const currentExample = this.examplesAndInferences[exampleId];
const lastInference = currentExample.inferences[currentExample.inferences.length - 1];
// or 
// const lastInference = currentExample.inferences.slice(-1)[0];
const labels = lastInference[modelIdx].slice(0, this.maxInferenceEntriesPerRun);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

for (let modelIdx = 0; modelIdx < data.length; modelIdx++) {
let modelDataToChart = {};
if (Object.keys(data[modelIdx]).length >
parseInt(this.maxInferenceEntriesPerRun)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parseInt should have a radix or you are supposed to use Number(this.maxInferenceEntriesPerRun) unless base is not 10.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, but stronger: parseInt should have a radix, but even then Number
is preferred by Google style, because parseInt("1 2 3") is 1 while
Number("1 2 3") is NaN. (Our internal TS style guide says “must not”
use parseInt.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@jameswex jameswex merged commit 63ab35a into tensorflow:master Jun 27, 2019
@jameswex jameswex deleted the multiclass branch June 27, 2019 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants