New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tfjs-vis] Support custom tickLabels with duplicate values in heatmaps #2012
Conversation
@caisq I finally got a chance to look at that long standing bug you reported. |
tfjs-vis/src/render/heatmap.ts
Outdated
transposed.dispose(); | ||
// Data validation | ||
const {xTickLabels, yTickLabels} = data; | ||
if (xTickLabels) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!= null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
tfjs-vis/src/render/heatmap.ts
Outdated
transposedShape}`); | ||
// Note that we will only do a check on the first element of the second | ||
// dimension. We do not protect users against passing in a ragged array. | ||
if (yTickLabels) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!= null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
// Download the intermediate tensor values and | ||
// dispose the transposed tensor. | ||
const transposedValues = await transposed.array(); | ||
transposed.dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have memory unit tests for this stuff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep!
Some of the code has also been simplified/refactored for clarity.
Heatmap Fix
Confusion matrix
This change is