Repository navigation
Conversation
cdavalos7
left a comment
There was a problem hiding this comment.
Thank you, this is so useful!
Tested locally with runs starting at steps 0, 5000 and 12000: the scalar curves align at 0 as expected.
One gap: in Relative Step mode the tooltip's "Step" column still shows the absolute step (5,980 / 12,980 / 980 at the same x), so the plotted value isn't visible anywhere. Could it show relativeStep in this mode? scalar_card_component.ng.html
| timeProperty(xAxisType: XAxisType) { | ||
| switch (xAxisType) { | ||
| case XAxisType.STEP: | ||
| case XAxisType.RELATIVE_STEP: |
There was a problem hiding this comment.
With Relative Step selected, histograms still show the original steps (5200–6800 and 12200–13800 below) instead of starting from 0. Relative Time does make each run's histogram start from 0, so the two modes behave differently. Could we support relative steps here too, or add a note that Relative Step only applies to scalar charts?
| })); | ||
|
|
||
| it('does not render fobs when axis type is RELATIVE', fakeAsync(() => { | ||
| it('does not render fobs when axis type is RELATIVE_TIME', fakeAsync(() => { |
There was a problem hiding this comment.
Relative Step disables linked time and the data table from settings because the existing checks compare === XAxisType.STEP. That seems right, since the selection is an absolute step, but it's implicit. Could you add RELATIVE_STEP cases here and in the does not render table... test?
f0c42a6 to
1087d0b
Compare
a28e439 to
ab9db69
Compare
287c68b to
a5bbb77
Compare
e04aca6 to
b76c806
Compare
Motivation for features / changes
Fixes #6969 (http://b/261046163).
When comparing runs that start at different step offsets (for example, fine-tuning from a checkpoint vs. training from step 0, or comparing runs resumed at different steps), plotting by absolute
Stepmakes side-by-side comparison difficult. Adding a Relative Step X-axis option normalizes each run (or partitioned pseudo-run) to start at step0(point.step - firstStep), similar to how Relative Time normalizeswallTime(point.wallTime - firstWallTime).Additionally, renaming the display label of
RelativetoRelative Time(XAxisType.RELATIVE_TIME) clarifies the distinction between relative step count and relative wall time.Technical description of changes
XAxisTypeenum (tensorboard/webapp/metrics/internal_types.ts):XAxisType.RELATIVEtoXAxisType.RELATIVE_TIME = 'relative_time'.XAxisType.RELATIVE_STEP = 'relative_step'.settings_view_component.ts):XAxisTypeDropdownOptionsto displayStep,Relative Step,Wall, andRelative Time.scalar_card_types.ts,scalar_card_container.ts,scalar_card_component.ts,scalar_card_line_chart_component.ts,scalar_card_line_chart_container.ts):relativeStep?: numbertoScalarCardPoint.relativeStep: point.step - firstStepper partitioned series inScalarCardContainerand mappedpoint.x = point.relativeStepwhenxAxisType === XAxisType.RELATIVE_STEP.XAxisType.RELATIVE_STEPto useScaleType.LINEAR,siNumberFormatter, and step-basedNaN/Infinityfiltering (isStepBased).histogram_card_component.ts):XAxisType.RELATIVE_STEPtoTimeProperty.STEPandXAxisType.RELATIVE_TIMEtoTimeProperty.RELATIVE.scalar_card_test.ts,scalar_card_line_chart_test.ts,histogram_card_test.ts):XAxisType.RELATIVEreferences toXAxisType.RELATIVE_TIMEand added unit tests coveringXAxisType.RELATIVE_STEPpoint calculation, axis formatting, and histogram time property mapping.Screenshots of UI changes (or N/A)
Detailed steps to verify changes work correctly (as executed by you)
webapptargets and executed thecard_rendererunit tests (scalar_card_test,scalar_card_line_chart_test,histogram_card_test).0,step - firstStep) and formats axis ticks with the SI number formatter.Alternate designs / implementations considered (or N/A)
Considered computing
point.step - series.points[0].stepinline only whenxAxisType === XAxisType.RELATIVE_STEPwithout storingrelativeSteponScalarCardPoint. Decided to storerelativeStep?: numberonScalarCardPointalongsiderelativeTimeInMsfor consistency and to make the relative step value available on the point object.