摘要: 4.1 模型构造 让我们回顾一下在3.10节(多层感知机的简洁实现)中含单隐藏层的多层感知机的实现方法。我们首先构造Sequential实例,然后依次添加两个全连接层。其中第一层的输出大小为256,即隐藏层单元个数是256;第二层的输出大小为10,即输出层单元个数是10。我们在上一章的其他节中也使用 阅读全文
posted @ 2021-03-01 17:21 zae 阅读(150) 评论(0) 推荐(0) 编辑
摘要: NN conv1d batchnorm1d CLASStorch.nn.``BatchNorm1d(num_features, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)[SOURCE] Applies Batch 阅读全文
posted @ 2021-03-01 17:18 zae 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 数据创建 torch.arange(1, 16) torch.eyes(n) 对角线为1的矩阵,若n==m。 torch.eye(n, m=None, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad= 阅读全文
posted @ 2021-03-01 17:16 zae 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 由于最近要使用Python操作MySQL数据库,所以要安装MySQLdb包。 手动安装 先去下载mysql-Python。(搜索Mysqlclient下面的,对应版本下载即可) 下载完成之后进入打开cmd,进入到下载包放入的Anaconda目录 cd C:\Users\MiMi Tian\Anaco 阅读全文
posted @ 2021-03-01 17:08 zae 阅读(325) 评论(0) 推荐(0) 编辑
摘要: Data We provide 4 HIN benchmark datasets: DBLP, Yelp, Freebase, and PubMed. Users can retrieve them here and unzip the downloaded file to the current 阅读全文
posted @ 2021-03-01 17:04 zae 阅读(653) 评论(0) 推荐(0) 编辑
摘要: 爬虫解析库:XPath dateTime = inner_html.xpath('//span[@class="laiyuan laiyuan1"]/span[@id="data"]/text()') 属性选择@,class、id等等。 子孙结点用//,子节点用/。 /text()转换文本。//te 阅读全文
posted @ 2021-03-01 16:59 zae 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 读文件 with open('raw.txt','r') as file: for line in file.readlines(): city=line.strip().split()[1] 写文件 with open(args.output, 'w') as file: file.write(f 阅读全文
posted @ 2021-03-01 16:53 zae 阅读(117) 评论(0) 推荐(0) 编辑