一篇不错的博客:https://blog.csdn.net/island1995/article/details/90200151
我在实践中使用 graph = np.zeros((h, w)) graph[np.where(label == 0)] = 1,对应的操作是在graph上进行的。所以label==0的索引位置变成了1,label != 0 的位置还是保持0,不适合我该部分的实验,因为我的是3分类,必须保证3种数值。
一篇不错的博客:https://blog.csdn.net/island1995/article/details/90200151
我在实践中使用 graph = np.zeros((h, w)) graph[np.where(label == 0)] = 1,对应的操作是在graph上进行的。所以label==0的索引位置变成了1,label != 0 的位置还是保持0,不适合我该部分的实验,因为我的是3分类,必须保证3种数值。