def ava2(x, alpha): first_num = tf.reshape(x[0, :], [1, -1]) x1 = x[:-1, :] x2 = x[1:, :] x_ = alpha * x1 + (1 - alpha) * x2 y = tf.concat([first_num, x_], axis=0) return y将这段代码的tf改为np
时间: 2024-01-29 12:02:54 浏览: 113
ava2核心技术原代码
def ava2(x, alpha):
first_num = np.reshape(x[0, :], [1, -1])
x1 = x[:-1, :]
x2 = x[1:, :]
x_ = alpha * x1 + (1 - alpha) * x2
y = np.concatenate([first_num, x_], axis=0)
return y
阅读全文