我使用的是库中的权重和偏差。我的模型输出一条曲线(时间序列)。我想看看这条曲线在整个训练过程中是如何变化的。所以,我需要一些滑块,在那里我可以选择时期,它显示了那个时期的曲线。它可以是与使用直方图非常相似的东西(它显示跨时期的直方图的图像,当你悬停它时,会显示对应于该时期的直方图)。有没有办法使用wandb来做这件事或类似的事情?
目前,我的代码如下所示:
for epoch in range(epochs):
output = model(input)
#output is shape (37,40) (lenght 40 and I have 37 samples)
#it's enough to plot the first sample
xs = torch.arange(40).unsqueeze(dim=1)
ys = output[0,:].unsqueeze(dim=1)
wandb.log({"line": wandb.plot.line_series(xs=xs, ys=ys,title="Out")}, step=epoch)如果有任何帮助,我将不胜感激!谢谢!
发布于 2021-05-08 06:35:00
您可以将wandb.log()与matplotlib一起使用。使用matplotlib创建绘图:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 50)
for i in range(1, 4):
fig, ax = plt.subplots()
y = x ** i
ax.plot(x, y)
wandb.log({'chart': ax})然后,当您查看wandb仪表板上的运行时,您将看到呈现为plot plot的图。单击左上角的齿轮可以看到一个滑块,它允许您在训练步骤上滑动并查看每个步骤的曲线图。
https://stackoverflow.com/questions/67202711
复制相似问题