Category Archives: PyTorch

A Big Step Closer to the IMDB Movie Sentiment Example Using PyTorch

I made a big step in getting closer to my goal of creating a PyTorch LSTM prediction system for the IMDB movie review data. The IMDB dataset has 50,000 real movie reviews: 25,000 training (12,500 positive reviews, 12,500 negative reviews) … Continue reading

Posted in Machine Learning, PyTorch | 1 Comment

I Simulate a PyTorch LSTM from Scratch

I’ve been investigating LSTM (long, short-term memory) networks for quite a long time. LSTM networks are very, very complex. As part of my path to knowledge, I simulated a PyTorch version of an LSTM cell (there are many slight variations … Continue reading

Posted in Machine Learning, PyTorch | Leave a comment

Why Isn’t batch_first the Default Geometry for PyTorch LSTM Modules?

I’ve been working for many weeks on dissecting PyTorch LSTM modules. An LSTM module is a very complex object that can be used to analyze natural language. The classic example is movie review sentiment. I’ve never happy unless I completely … Continue reading

Posted in Machine Learning, PyTorch | 1 Comment

The PyTorch view() reshape() squeeze() and flatten() Functions

I was teaching a workshop on PyTorch deep neural networks recently and I noticed that people got tripped up on some of the details. For example, the differences between view() and reshape(), and between squeeze() and flatten() are important to … Continue reading

Posted in PyTorch

The PyTorch LSTM Module Input Shape Tricked Me Again

Grrrr. I’ve been wrestling with PyTorch LSTM (long, short-term memory) code for many weeks now. Some time ago I thought I had figured out how to deal with the shapes of the input and output tensors. But I discovered I … Continue reading

Posted in PyTorch | 1 Comment

Sentiment Analysis Using a PyTorch LSTM

I’ve been poking away for many weeks on the problem of sentiment analysis using a PyTorch LSTM (long short-term memory) network. Specifically, my ultimate goal is to create a prediction model for the IMDB movie review dataset. As it turns … Continue reading

Posted in Machine Learning, PyTorch

The PyTorch Parts of Speech LSTM Example

For the past several weeks I’ve been exploring LSTM networks using the PyTorch code library. My ultimate goal is to create a PyTorch demo for the IMDB movie review sentiment analysis example. In that example, you train an LSTM recurrent … Continue reading

Posted in Machine Learning, PyTorch