Build and Train a PyTorch LSTM in Under 100 Lines of Code
HTML-код
- Опубликовано: 6 сен 2024
- Mentioned Articles:
LSTM (in Keras): pythonalgos.co...
_ Variables: pythonalgos.co...
Optimizers (in Keras): pythonalgos.co...
Want to learn more Python and ML with a community?
Come join our Discord Community: / discord
Check out more content like this (in blog form) at www.PythonAlgo...
recently came across this channel and I'm enjoying this style of content, many thanks!
Thank you very much for your work! Helped me a lot!
Why do we need to intialize the hidden_states and cell_states of the lstm every training step?
hidden state weights are not retained from each training step, also i don't believe i'm initializing them every step, just each epoch, you can also re-initialize each batch if you are doing truncated backprop through time
obviously you have to read the docstrings to do the Class LSTM(nn.module): part? ....no?
RuntimeError: Trying to backward through the graph a second time (or directly access saved tensors after they have already been freed). Saved intermediate values of the graph are freed when you call .backward() or autograd.grad(). Specify retain_graph=True if you need to backward through the graph a second time or if you need to access saved tensors after calling backward. I took this error. (I am not using the same dataset). Thank you.
there is not enough link to githov so as not to copy the code manually from the screen to your computer. think about it in the future. the video also starts with some kind of vague start, as if I had to watch some previous videos before it, although it does not say that this is part 2 or something like that.
Here's the github: github.com/ytang07/nn_examples/blob/main/pytorch/rnn/lstm.ipynb