摘要: pip pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package pypi 镜像每 5 分钟同步一次,所以应该是非常靠谱的 conda conda config --add channels https://mirror 阅读全文
posted @ 2019-07-19 16:58 sbj123456789 阅读(12930) 评论(0) 推荐(0) 编辑
摘要: source 在当前shell中读取a.sh并执行 a.sh不需要有执行权限 source命令可以简写为" . "(如:. a.sh ) bash/sh 打开一个subshell去读取并执行a.sh,一旦这个subshell执行完马上退出 a.sh不需要有执行权限 bash和sh的区别: 使用sh调 阅读全文
posted @ 2019-07-17 10:17 sbj123456789 阅读(1404) 评论(0) 推荐(0) 编辑
摘要: 几大重要的数据结构:数组(线性表)、链表、hash表 分别对应了python中的list、deque、dict、set,但其内部实现原理比C的要复杂不少,也有很多好用的接口 list python中的list要满足以下要求: 是数组类型,以索引就可以直接取到元素,O(1)取元素 元素可以是任意类型 阅读全文
posted @ 2019-07-10 14:26 sbj123456789 阅读(2587) 评论(0) 推荐(1) 编辑
摘要: 安装python版的hanlp时老是出错,直接 pip install pyhanlp,会出现这个错误: 最后的解决办法是参考: https://stackoverflow.com/questions/54016317/error-in-installing-jpype1-in-python-3-7 阅读全文
posted @ 2019-07-09 16:41 sbj123456789 阅读(1990) 评论(0) 推荐(0) 编辑
摘要: 美国八个免税州: 华盛顿州、内华达州、怀俄明州、南达科他州、德克萨斯州、佛罗里达、阿拉斯加州、田纳西州(新加入的) 阅读全文
posted @ 2019-06-26 13:02 sbj123456789 阅读(643) 评论(0) 推荐(0) 编辑
摘要: Python第三方库jieba(中文分词)入门与进阶(官方文档) Python第三方库jieba(中文分词)入门与进阶(官方文档) https://blog.csdn.net/qq_34337272/article/details/79554772 简明 jieba 中文分词教程 https://w 阅读全文
posted @ 2019-06-25 19:39 sbj123456789 阅读(262) 评论(0) 推荐(0) 编辑
摘要: Question There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time comp 阅读全文
posted @ 2019-06-09 19:09 sbj123456789 阅读(126) 评论(0) 推荐(0) 编辑
摘要: numpy中有函数argsort来返回排序后的下标 pytorch中的torch.sort本身就能返回排序后的下标 Python中没有直接调用的接口,怎么办呢? 用enumerate再排序就可以了 阅读全文
posted @ 2019-05-30 19:32 sbj123456789 阅读(9371) 评论(0) 推荐(1) 编辑
摘要: Pytorch中的Tensor常用的类型转换函数(inplace操作): (1)数据类型转换 在Tensor后加 .long(), .int(), .float(), .double()等即可,也可以用.to()函数进行转换,所有的Tensor类型可参考https://pytorch.org/doc 阅读全文
posted @ 2019-05-09 16:01 sbj123456789 阅读(81013) 评论(0) 推荐(1) 编辑
摘要: model.train() :启用 BatchNormalization 和 Dropout model.eval() :不启用 BatchNormalization 和 Dropout 参考: https://pytorch.org/docs/stable/nn.html?highlight=mo 阅读全文
posted @ 2019-05-07 15:23 sbj123456789 阅读(37652) 评论(0) 推荐(2) 编辑