我有两个数组 X 和 Y。
在 tensorboard 中,有没有可以进行平滑处理的函数?
目前,我可以通过 python 的另一种方式进行平滑处理,像这样:
sav_smoooth = savgol_filter(Y, 51, 3)
plt.plot(X, Y)
但我不确定 tensorboard 平滑处理的方法是什么。是否有函数可供调用?
谢谢。
我有两个数组 X 和 Y。
在 tensorboard 中,有没有可以进行平滑处理的函数?
目前,我可以通过 python 的另一种方式进行平滑处理,像这样:
sav_smoooth = savgol_filter(Y, 51, 3)
plt.plot(X, Y)
但我不确定 tensorboard 平滑处理的方法是什么。是否有函数可供调用?
谢谢。
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