我有两个数组 X 和 Y。
我可以在 tensorboard 中调用一个函数来平滑吗?
现在我可以在 python 中做一个替代方法,比如:
sav_smoooth = savgol_filter(Y, 51, 3)
plt.plot(X, Y)
但是我不确定 tensorboard 做的怎么样。有我可以调用的功能吗?
谢谢。
最佳答案
到目前为止我还没有找到手动调用它的方法,但是你可以构造一个类似的函数,
基于此answer , 函数会是这样的
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
关于python - 是否可以手动调用 tensorboard smooth 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42011419/