是否可以手动调用tensorboard smooth函数?

Kai*_*Lin 5 python tensorflow tensorboard

我有两个数组 X 和 Y。

我可以在张量板上调用一个函数来实现平滑吗?

现在我可以用 python 做另一种方式,例如: sav_smoooth = savgol_filter(Y, 51, 3) plt.plot(X, Y) 但我不确定张量板的平滑方式是什么。有我可以调用的函数吗?

谢谢。

Mik*_*e W 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
Run Code Online (Sandbox Code Playgroud)