摘要: import torch.nn as nn import torchvision.models as models class resnet(nn.Module): def __init__(self): super(resnet,self).__init__() self.model = mode 阅读全文
posted @ 2020-06-20 23:20 爱豆^2 阅读(1134) 评论(0) 推荐(0) 编辑
摘要: import numpy as np from scipy.linalg import expm,logm #矩阵指数计算 x = expm(np.ones((2,2))) #矩阵对数计算 y = logm(np.ones((2,2))) 阅读全文
posted @ 2020-06-13 14:57 爱豆^2 阅读(3691) 评论(1) 推荐(0) 编辑
摘要: class _NormBase(Module): #源码 """Common base of _InstanceNorm and _BatchNorm""" _version = 2 __constants__ = ['track_running_stats', 'momentum', 'eps', 阅读全文
posted @ 2020-04-16 23:39 爱豆^2 阅读(3153) 评论(0) 推荐(0) 编辑
摘要: 调用预训练模型 ResNet18 时报错:RuntimeError: Given input size: (512x3x3). Calculated output size: (512x-3x-3). Output size is too small at /opt/conda/conda-bld/ 阅读全文
posted @ 2020-03-28 14:52 爱豆^2 阅读(9264) 评论(0) 推荐(0) 编辑
摘要: 在打开文件时出现“'gbk' codec can't decode byte 0xa6 in position 4: illegal multibyte sequence”报错,解决如下: open(path,'rb'),即在读取文本的时候加入参数‘b’。 阅读全文
posted @ 2020-03-17 11:16 爱豆^2 阅读(3297) 评论(0) 推荐(1) 编辑
摘要: python在Windows上,文件的路径分隔符是'\',在Linux上是'/'。为了让代码在不同的平台上都能运行,使用os.sep即可,os.sep根据你所处的平台,自动采用相应的分隔符号。 例:(Windows) os.path.join(os.sep, 'a', 'b', 'c', 'd') 阅读全文
posted @ 2020-01-02 15:32 爱豆^2 阅读(1153) 评论(0) 推荐(0) 编辑
摘要: 参见https://blog.csdn.net/weixin_37589575/article/details/92801610 目录(一)Few-shot learning(少样本学习)1. 问题定义2. 解决方法2.1 数据增强和正则化2.2 Meta-learning(元学习)(二)Meta- 阅读全文
posted @ 2019-12-26 17:02 爱豆^2 阅读(937) 评论(0) 推荐(0) 编辑
摘要: 面对GitHub上海量的开源项目,如何能做到精确查找,搜索框输入的条件可总结如下: 1,基于条件: stars:>100 forks:>1000 pushed:>2019-11-11 language:python 2,在某一类中查找: in:describtion XXX in:name XXX 阅读全文
posted @ 2019-11-17 11:26 爱豆^2 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 安装pyltp包的过程中有很多bug,目前我所遇到的问题是,在pip install pyltp时卡在安装出不动。查了很多教程,也试了很多方法,下面推荐一下可行的安装方法: 1,下载wheels文件 python3.6版本:链接:https://pan.baidu.com/s/1qy1xrJzM6C 阅读全文
posted @ 2019-11-15 15:22 爱豆^2 阅读(507) 评论(0) 推荐(0) 编辑
摘要: pip install pyhanlp 安装失败的话可以去https://github.com/hankcs/pyhanlp下载pyhanlp-master.zip,然后用一下命令安装: pip install pyhanlp-master.zip **问题1:**import pyhanlp时报错 阅读全文
posted @ 2019-11-12 19:37 爱豆^2 阅读(2396) 评论(0) 推荐(0) 编辑