【问题标题】:Is it possible to call tensorboard smooth function manually?是否可以手动调用张量板平滑功能?
【发布时间】:2017-02-02 20:09:30
【问题描述】:
我有两个数组 X 和 Y。
我可以在 tensorboard 中调用一个函数来进行平滑处理吗?
现在我可以在 python 中使用另一种方法,例如:
sav_smoooth = savgol_filter(Y, 51, 3)
plt.plot(X, Y)
但我不确定 tensorboard 的平滑方式是什么。有我可以调用的函数吗?
谢谢。
【问题讨论】:
标签:
python
tensorflow
tensorboard
【解决方案1】:
目前还没有找到手动调用的方法,不过可以构造一个类似的函数,
基于这个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