Coder Social home page Coder Social logo

pytorch-course's Introduction

PyTorch course

Announcement

这个project是基于PyTorch 0.4.0版本写的。由于现在的PyTorch已经升级到了1.6.0版本,很多代码的写法不太符合最新的版本,所以欢迎大家重写我的代码然后send pull request!

A PyTorch tutorial

褚则伟 [email protected]

pytorch-course's People

Contributors

zeweichu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pytorch-course's Issues

RuntimeError: CUDA error: out of memory


RuntimeError Traceback (most recent call last)
in
11
12 if USE_CUDA:
---> 13 input_labels = input_labels.cuda()
14 pos_labels = pos_labels.cuda()
15 neg_labels = neg_labels.cuda()

RuntimeError: CUDA error: out of memory

请问实现luong attn的时候为什么是用context来计算的

论文中写的是用target的当前hiddenstate和整个Encoder_outputs来计算,但是第七课seq2seq的代码中是这样算的:
context_in = self.linear_in(context.view(batch_size*input_len, -1)).view( batch_size, input_len, -1)
attn = torch.bmm(output, context_in.transpose(1,2))
这里的context是不是应该更换成当前时刻的hiddenstate

3.language-model.ipynb中最后一层为什么使用的linear层而不是softmax

褚博士,您好
我想问下第三课语言模型中为什么最后一层使用的是linear而不是softmax?这样做似乎对这个模型没有什么影响,loss依然下降了,但最后输出应该是一个分类器。这就相当于做二分类任务时,不用sigmoid直接用交叉熵CE作为loss函数,想请教下这样对于分类会造成什么样的影响?反之,如果做分类任务时,不用交叉熵只用sigmoid和MSE作为loss函数,又会有什么影响呢?感觉后者的影响更大。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.