Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to call tensorboard smooth function manually?

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.

like image 988
Kaixiang Lin Avatar asked Oct 29 '22 12:10

Kaixiang Lin


1 Answers

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
like image 142
Mike W Avatar answered Nov 15 '22 07:11

Mike W