能否手动调用TensorBoard的平滑函数?

5

我有两个数组 X 和 Y。

在 tensorboard 中,有没有可以进行平滑处理的函数?

目前,我可以通过 python 的另一种方式进行平滑处理,像这样:

sav_smoooth = savgol_filter(Y, 51, 3) plt.plot(X, Y)

但我不确定 tensorboard 平滑处理的方法是什么。是否有函数可供调用?

谢谢。


请下载平滑的TensorBoard值。相关链接:https://stackoverflow.com/questions/45496989/download-smoothed-tensorboard-values/69353117#69353117 - Charlie Parker
这回答您的问题了吗?TensorBoard的标量图中,“平滑”参数背后的数学是什么?(https://dev59.com/gFgQ5IYBdhLWcg3wvGi4) - Charlie Parker
1个回答

2
到目前为止,我还没有找到手动调用它的方法,但是您可以构建一个类似的函数,基于这个答案,该函数将如下所示:
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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接