Python 是否可以手动调用张力板平滑功能?

Python 是否可以手动调用张力板平滑功能?,python,tensorflow,tensorboard,Python,Tensorflow,Tensorboard,我有两个数组X和Y 有没有一个函数我可以调用在tensorboard做平滑 现在,我可以在python中使用另一种方法,如: sav_-smooth=savgol_滤波器(Y,51,3) 平面图(X,Y) 但我不确定张力板是怎样平滑的。有我可以调用的函数吗 谢谢 到目前为止,我还没有找到手动调用它的方法,但是您可以构造一个类似的函数 基于此,函数将类似于 def smooth(scalars, weight): # Weight between 0 and 1 last = sca

我有两个数组X和Y

有没有一个函数我可以调用在tensorboard做平滑

现在,我可以在python中使用另一种方法,如:

sav_-smooth=savgol_滤波器(Y,51,3)
平面图(X,Y)
但我不确定张力板是怎样平滑的。有我可以调用的函数吗


谢谢

到目前为止,我还没有找到手动调用它的方法,但是您可以构造一个类似的函数

基于此,函数将类似于

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