摘要:
pytorch 中forward 的用法与解释说明 另外,关于__call__()方法,可参考:Python __call__()方法 阅读全文
摘要:
参考资料: sklearn调包侠之KNN算法 深入浅出KNN算法(一) KNN算法原理 深入浅出KNN算法(二) sklearn KNN实践 KNN的原理就是当预测一个新的值x的时候,根据它距离最近的K个点是什么类别来判断x属于哪个类别。 KNN是有监督学习中的分类算法,也就是已知训练样本的labe 阅读全文
摘要:
matplotlib, 去除plt.savefig()的白边 阅读全文
摘要:
余弦相似性: 只适用于A和B的各个元素都为正的情况。 对于A和B的元素可能为负的情况,可采用下面的cos距离函数: 阅读全文
摘要:
【1】混淆矩阵(Confusion Matrix)概念 【2】 混淆矩阵-百度百科 【3】 Python中生成并绘制混淆矩阵(confusion matrix) 【4】 使用python绘制混淆矩阵(confusion_matrix) 示例: Python画混淆矩阵程序示例,摘自【4】。 from 阅读全文
摘要:
Tmux 使用教程 创建tmux: tmux new -s 名字 进入已创建的tmux: tmux a -t 名字 临时退出tmux: tmux detach 杀死tmux。如果在tmux外: tmux kill-session -t 名字 ;如果在tmux内: ctrl + d 列出已有的tmux 阅读全文
摘要:
torch.cuda.empty_cache()的作用 【摘自https://zhuanlan.zhihu.com/p/76459295】 显存优化 可参考: pytorch 减小显存消耗,优化显存使用,避免out of memory 再次浅谈Pytorch中的显存利用问题(附完善显存跟踪代码) 阅读全文
摘要:
Python的内存管理(文章清晰简单) python内存管理,引用计数,循环引用,内存泄漏调试 阅读全文