随笔分类 -  pytorch

摘要:1. paper: Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation Encoder 每个时刻输入一个词,隐藏层状态根据公式ht=f(ht−1,xt)改变。其中激 阅读全文
posted @ 2019-11-16 16:03 _Meditation 阅读(872) 评论(0) 推荐(0) 编辑
摘要:论文通过实现RNN来完成了文本分类。 论文地址:88888888 模型结构图: 原理自行参考论文,code and comment(https://github.com/graykode/nlp-tutorial): 1 # -*- coding: utf-8 -*- 2 # @time : 201 阅读全文
posted @ 2019-11-09 16:27 _Meditation 阅读(1093) 评论(0) 推荐(0) 编辑
摘要:论文 《 Convolutional Neural Networks for Sentence Classification》通过CNN实现了文本分类。 论文地址: 666666 模型图: 模型解释可以看论文,给出code and comment:https://github.com/graykod 阅读全文
posted @ 2019-11-09 15:13 _Meditation 阅读(1623) 评论(0) 推荐(0) 编辑
摘要:论文来自Mikolov等人的《Efficient Estimation of Word Representations in Vector Space》 论文地址: 66666 论文介绍了2个方法,原理不解释... skim code and comment https://github.com/g 阅读全文
posted @ 2019-11-09 13:54 _Meditation 阅读(438) 评论(0) 推荐(1) 编辑
摘要:论文地址:http://www.iro.umontreal.ca/~vincentp/Publications/lm_jmlr.pdf 论文给出了NNLM的框架图: 针对论文,实现代码如下(https://github.com/graykode/nlp-tutorial): 1 # -*- codi 阅读全文
posted @ 2019-11-09 12:58 _Meditation 阅读(635) 评论(0) 推荐(0) 编辑
摘要:###仅为自己练习,没有其他用途 1 import torch 2 import torch.nn as nn 3 import torch.utils.data as Data 4 import torchvision 5 import matplotlib.pyplot as plt 6 fro 阅读全文
posted @ 2019-10-29 18:23 _Meditation 阅读(431) 评论(0) 推荐(0) 编辑
摘要:上次通过pytorch实现了RNN模型,简易的完成了使用RNN完成mnist的手写数字识别,但是里面的参数有点不了解,所以对问题进行总结归纳来解决。 总述:第一次看到这个函数时,脑袋有点懵,总结了下总共有五个问题: 1.这个input_size是啥?要输入啥?feature num又是啥? 2.这个 阅读全文
posted @ 2019-10-29 18:15 _Meditation 阅读(4092) 评论(0) 推荐(1) 编辑
摘要:关于RNN模型参数的解释,可以参看RNN参数解释 ###仅为自己练习,没有其他用途 1 import torch 2 from torch import nn 3 import numpy as np 4 import matplotlib.pyplot as plt 5 6 # torch.man 阅读全文
posted @ 2019-10-29 17:42 _Meditation 阅读(387) 评论(0) 推荐(0) 编辑
摘要:###仅为自己练习,没有其他用途 1 import torch 2 from torch import nn 3 import torchvision.datasets as dsets 4 import torchvision.transforms as transforms 5 import m 阅读全文
posted @ 2019-10-29 16:00 _Meditation 阅读(595) 评论(0) 推荐(0) 编辑
摘要:###仅为自己练习,没有其他用途 1 # library 2 # standard library 3 import os 4 5 # third-party library 6 import torch 7 import torch.nn as nn 8 import torch.utils.da 阅读全文
posted @ 2019-10-29 15:35 _Meditation 阅读(225) 评论(0) 推荐(0) 编辑
摘要:1 import torch 2 import torch.utils.data as Data 3 import torch.nn.functional as F 4 import matplotlib.pyplot as plt 5 import torch.optim 6 # torch.manual_seed(1) # reproducible 7 8 LR = ... 阅读全文
posted @ 2019-10-26 15:00 _Meditation 阅读(198) 评论(0) 推荐(0) 编辑
摘要:1 import torch 2 import torch.utils.data as Data 3 4 torch.manual_seed(1) # reproducible 5 6 BATCH_SIZE = 5 7 # BATCH_SIZE = 8 8 9 x = torch.linspace(1, 10, 10) # this is x data ... 阅读全文
posted @ 2019-10-26 14:05 _Meditation 阅读(917) 评论(0) 推荐(0) 编辑
摘要:1 import torch 2 import matplotlib.pyplot as plt 3 4 # torch.manual_seed(1) # reproducible 5 6 # fake data 7 x = torch.unsqueeze(torch.linspace(-1, 1, 100), dim=1) # x data (tensor), sha... 阅读全文
posted @ 2019-10-26 13:57 _Meditation 阅读(324) 评论(0) 推荐(0) 编辑
摘要:1 import torch 2 import torch.nn.functional as F 3 4 5 # replace following class code with an easy sequential network 6 class Net(torch.nn.Module): 7 def __init__(self, n_feature, n_hidd... 阅读全文
posted @ 2019-10-26 13:56 _Meditation 阅读(171) 评论(0) 推荐(0) 编辑
摘要:1 import torch 2 import torch.nn.functional as F 3 import matplotlib.pyplot as plt 4 5 # torch.manual_seed(1) # reproducible 6 7 # make fake data 8 n_data = torch.ones(100, 2) 9 x0 = to... 阅读全文
posted @ 2019-10-26 13:48 _Meditation 阅读(318) 评论(0) 推荐(0) 编辑
摘要:1 import torch 2 import torch.nn.functional as F 3 import matplotlib.pyplot as plt 4 5 # torch.manual_seed(1) # reproducible 6 7 x = torch.unsqueeze(torch.linspace(-1, 1, 100), dim=1) # x data (tensor 阅读全文
posted @ 2019-10-26 13:33 _Meditation 阅读(350) 评论(0) 推荐(0) 编辑
摘要:1 import torch 2 import torch.nn.functional as F 3 from torch.autograd import Variable 4 import matplotlib.pyplot as plt 5 6 # fake data 7 x = torch.linspace(-5, 5, 200) # x data (tensor), shape=(100, 阅读全文
posted @ 2019-10-26 13:24 _Meditation 阅读(354) 评论(0) 推荐(0) 编辑
摘要:1 import torch 2 from torch.autograd import Variable 3 4 # Variable in torch is to build a computational graph, 5 # but this graph is dynamic compared with a static graph in Tensorflow or Theano. 6 # 阅读全文
posted @ 2019-10-26 13:13 _Meditation 阅读(765) 评论(0) 推荐(0) 编辑
摘要:1 import torch 2 import numpy as np 3 4 # details about math operation in torch can be found in: http://pytorch.org/docs/torch.html#math-operations 5 阅读全文
posted @ 2019-10-26 13:12 _Meditation 阅读(280) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示