修改以下代码,在errdict仅包含一个元素时要求将其显示在左侧纵轴,如果包含两个将其分别显示在左侧和右侧的横轴上 def drawingerror(times,…
Jump to turn (9)
- 1修改以下代码,在errdict仅包含一个元素时要求将其显示在左侧纵轴,如果包含两个将其分别显示在左侧和右侧的横轴上 def drawingerror(times
- 2axleft.setxlabel(‘Iter times’) axleft.tickparams(axis=‘y’, labelcolor=‘tab:blue’
- 3一般怎么设置学习率比较合适
- 4以下得到的axright的刻度过大,并不是按照数据来定的 keys = list(errdict.keys()) val1, val2 = errdict[ke
- 5nx.shortestpath(edgegraph, source=self.refidx, target=1, weight='weight') networ
- 6可是相关节点已经通过以下添加到图中了啊 edgegraph.addedge(item[0], item[1], weight=scoredict[item])
- 7edgegraph.nodes NodeView((0, 7, 2, 5, 1, 4, 3, 6))
- 8怎么使用size为[4]的张量A作为索引,在[4,8,8,7]中的张量B中找到沿着dim=1维度的对应位置的size为[4,8,7]的张量
- 9rel8 = torch.cat(([refinerelR[b, refidxs[b]].unsqueeze(0) for b in range(B)]), d
- User
修改以下代码,在err_dict仅包含一个元素时要求将其显示在左侧纵轴,如果包含两个将其分别显示在左侧和右侧的横轴上 def drawing_error(times, err_dict): import matplotlib.pyplot as plt import numpy as np def _to_numpy(x): x = torch.stack(x) return x.detach().cpu().numpy() times = np.stack(times) rot_error = np.stack(rot_error)
codefor key, val in err_dict.items(): val = _to_numpy(val) plt.plot(times, val, label=key) fig, ax1 = plt.subplots() ax1.set_xlabel('iter times') ax1.set_ylabel('rot error(degs)', color='tab:blue') ax1.plot(times, rot_error, color='tab:blue') ax1.legend(["rot error"], loc='upper left') # plt.show() plt.savefig("/home/wangzhiwei/pose_estimate/GloPose-train-unorder/opencv_reference/1127_1725_COA_N8_B16_DDP/vis_output/rot_error.png") - Assistant