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...

Комментарии • 8

  • @AmritBasi
    @AmritBasi Год назад +4

    recently came across this channel and I'm enjoying this style of content, many thanks!

  • @ivanzelenin3986
    @ivanzelenin3986 3 месяца назад +1

    Thank you very much for your work! Helped me a lot!

  • @AlexeyMatushevsky
    @AlexeyMatushevsky Год назад +4

    Why do we need to intialize the hidden_states and cell_states of the lstm every training step?

    • @yujiantang
      @yujiantang  Год назад

      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

  • @michaelmoore7568
    @michaelmoore7568 2 месяца назад

    obviously you have to read the docstrings to do the Class LSTM(nn.module): part? ....no?

  • @emirhanozmen2289
    @emirhanozmen2289 Месяц назад

    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.

  • @777TYT
    @777TYT Год назад +3

    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.

    • @yujiantang
      @yujiantang  Год назад +2

      Here's the github: github.com/ytang07/nn_examples/blob/main/pytorch/rnn/lstm.ipynb