Comments (1)
Hi yes I'm a little confused about a few of things.
def train(input, target):
...
for c in range(chunk_len):
output, hidden = decoder(inp[c], hidden)
loss += criterion(output, target[c])
like you're defining each training loop of the rnn to cycle individually through of charcters in the sequence.
-
Wouldnt that mean that a training loop is only a small part of the whole dataset and definitely not a whole epoch?
-
I noticed that on this page you changed the forward method to also have a non-unit batch dimension.
https://github.com/spro/char-rnn.pytorch/blob/master/train.py . Is there any reason you went with batch_size = 1 in this tutorial ? -
also i thought you didnt need to break up your sequence inputs to the rnn? Eg if i take out the for loop and just feed in the input:
def train(input, target):
output, h = charnn(input, hidden)
the model doesnt return an error? would cycling a sequence at a time rather than a sequential unit at a time not work instead and be simpler?
If you cycle through each character individually as you've done, then does that mean that the model is any different to one that goes sequence by sequence ?
I was thinking that in an attention model the for loop might help you 'collect up' the hidden state at each timestep, since only the last hidden state is returned by default, but you're not applying attention here. So I cant think of a reason...
Thanks for any help, and I think your tutorials are fantastic.
from practical-pytorch.
Related Issues (20)
- Issue on Windows
- Seq-seq not working for creating chatbot
- How to save and load train model and use it for evaluation HOT 2
- Link for Series 2 - RNNs for time-series data
- Question about Luong Attention Implementation HOT 7
- can't import torch HOT 2
- The link for Teacher Forcing in "Translation with a Sequence to Sequence Network and Attention" is broken
- Error in BahdanauAttnDecoderRNN HOT 1
- Issues in your tutorial on Classifying Names with a Character-Level RNN
- I can't calculate the score of attention in Seq2Seq Translation. HOT 2
- Error in practical-pytorch/seq2seq-translation/seq2seq-translation-batched.ipynb
- Question from character level RNN classifier, why not use the hidden state across epochs? HOT 1
- RuntimeError: 1D tensors expected, got 2D, 2D tensors HOT 1
- May I know how to support a new sentence translation?
- seq2seq: Replace the embeddings with pre-trained word embeddings such as word2vec
- About seq2seq-translation-batched.py RuntimeError HOT 1
- Wrong implementation of attention mechanism in pytorch tutorials
- FileNotFoundError: [Errno 2] No such file or directory: 'char-rnn-classification.pt'
- small format issue
- Implicit dimension choice for log_softmax has been deprecated while running 'python train.py'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from practical-pytorch.