摘要:
方法一: 使用dict.items()方式 dict_ori = {'A':1, 'B':2, 'C':3} dict_new = {value:key for key,value in dict_ori.items()} 方法二: 使用zip方法 dict_ori = {'A':1, 'B':2, 阅读全文
摘要:
test = np.array([[1, 2, 3], [2, 3, 4], [5, 4, 3], [8, 7, 2]])np.argmax(test, 0) #输出:array([3, 3, 1]np.argmax(test, 1) #输出:array([2, 2, 0, 0] 阅读全文
摘要:
将mask中所有为true的抽取出来,放到一起,这里从n维降到1维度 tensor = [[1, 2], [3, 4], [5, 6]] import numpy as np mask=np.array([[True,True],[False,True],[False,False]]) z=tf.b 阅读全文
摘要:
ubuntu下将程序挂后台命令 nohup python -u main.py > test.out 2>&1 & ubunut下查看后台进程 jobs -l 阅读全文