Category Archives: PyTorch

Computing PyTorch Model Accuracy is Not Trivial

I’ve been using the PyTorch neural code library since it was first released, just over three years ago Recently, I’ve been refactoring a lot of my demo programs to update them to new PyTorch features and best practices. During model … Continue reading

Posted in PyTorch | Leave a comment

Limiting the Size of a PyTorch Dataset / DataLoader

When developing a deep neural model, you normally start by working with a relatively small subset of your data, which saves a huge amount of time. The most common way to read and use training and test data when using … Continue reading

Posted in PyTorch | Leave a comment

Installing PyTorch 1.5 for CPU on Windows 10 with Anaconda 2020.02 for Python 3.7

PyTorch is a deep neural code library that you can access using the Python programming language. Anaconda is a collection of software packages that contains a base Python engine plus over 500 compatible Python packages. Prerequisites: A machine with a … Continue reading

Posted in PyTorch | Leave a comment

A Minimal PyTorch Complete Example

I have taught quite a few workshops on the PyTorch neural network library. Learning PyTorch (or any other neural code library) is very difficult and time consuming. If beginners start without knowledge of some fundamental concepts, they’ll be overwhelmed quickly. … Continue reading

Posted in PyTorch | Leave a comment

Why Does PyTorch Have Three Different softmax() Functions?

I’ve been using the PyTorch neural code library since version 0.2 in early 2017 and I like PyTorch a lot. Even though PyTorch is slowly but surely stabilizing, there are still quite a few things about PyTorch that let you … Continue reading

Posted in PyTorch | Leave a comment

Using a PyTorch DataLoader and Dataset From Iris Text Data

In a previous blog post, I showed how to create a PyTorch Dataset from the well-known Iris data. See jamesmccaffrey.wordpress.com/2020/05/10/creating-a-pytorch-dataset-from-iris-text-data/. I used a 9-item subset of the Iris data. In my demo, I set batch_size = 2 so there are … Continue reading

Posted in PyTorch

Creating a PyTorch Dataset From Iris Text Data

Here’s an example of how to create a PyTorch Dataset object from the Iris dataset. The PyTorch neural network library is slowly but surely stabilizing. The use of DataLoader and Dataset objects is now pretty much the standard way to … Continue reading

Posted in PyTorch