5

I have two arrays X and Y.

Is there a function I can call in tensorboard to do the smooth?

Right now I can do an alternative way in python like: sav_smoooth = savgol_filter(Y, 51, 3) plt.plot(X, Y) But I am not sure what's way tensorboard do smooth. Is there a function I can call?

Thanks.

Kaixiang Lin
  • 229
  • 1
  • 3
  • 9
  • related: https://stackoverflow.com/questions/45496989/download-smoothed-tensorboard-values/69353117#69353117 – Charlie Parker Sep 27 '21 at 20:50
  • Does this answer your question? [What is the mathematics behind the "smoothing" parameter in TensorBoard's scalar graphs?](https://stackoverflow.com/questions/42281844/what-is-the-mathematics-behind-the-smoothing-parameter-in-tensorboards-scalar) – Charlie Parker Sep 27 '21 at 20:51

1 Answers1

2

So far I haven't found a way to call it manually, but you can construct a similar function,

based on this answer, the function will be something like

def smooth(scalars, weight):  # Weight between 0 and 1
    last = scalars[0]  # First value in the plot (first timestep)
    smoothed = list()
    for point in scalars:
        smoothed_val = last * weight + (1 - weight) * point  # Calculate smoothed value
        smoothed.append(smoothed_val)                        # Save it
        last = smoothed_val                                  # Anchor the last smoothed value

    return smoothed
Mike W
  • 1,303
  • 1
  • 21
  • 31