Author Archives: jamesdmccaffrey

PyTorch train() vs. eval() Mode

The bottom line of this post is: If you use dropout in PyTorch, then you must explicitly set your model into evaluation mode by calling the eval() function mode when computing model output values. Bear with me here, this is … Continue reading

Posted in Machine Learning, PyTorch | Leave a comment

Matrices with JavaScript

Like many programmers, I have a love-hate relationship with the JavaScript language. I’m quite familiar with the language but I sometimes go long stretches of time where I don’t use it frequently. A few days ago, a book publisher contacted … Continue reading

Posted in Machine Learning | Leave a comment

NFL 2018 Super Bowl LIII (Week 21) Prediction – Zoltar Says the Rams Will Win by One Point

Zoltar is my NFL prediction computer program. It uses a deep neural network and reinforcement learning. Here is Zoltar’s prediction for Super Bowl LIII for the 2018 NFL season, to be played on Sunday, February 3, 2019: Zoltar: rams by … Continue reading

Posted in Zoltar | Leave a comment

My Top Ten Favorite Movies that Take Place on an Airplane

I enjoy movies that take place in a confined area such as a boat, a train, an Artic outpost, or an airplane. The space constraint forces writers, directors, and actors to be clever and creative. Although many movies have a … Continue reading

Posted in Top Ten | Leave a comment

Image Classification Using Keras

I wrote an article titled “Image Classification Using Keras” in the December 2018 issue of Visual Studio Magazine. See https://visualstudiomagazine.com/articles/2018/12/01/image-classification-keras.aspx. Keras is a neural network library. Keras actually is a layer of abstraction on top of the TensorFlow library. The … Continue reading

Posted in Keras | Leave a comment

Introduction to PyTorch on Windows

I wrote an article titled “Introduction to PyTorch on Windows” in the January 2019 issue of Microsoft MSDN Magazine. See https://msdn.microsoft.com/en-us/magazine/mt848704. Among my colleagues, the most commonly used neural network libraries are TensorFlow, Keras, CNTK, and, increasingly, PyTorch. I like … Continue reading

Posted in PyTorch | Leave a comment

Anomaly Detection Using a Deep Neural Autoencoder

Anomaly detection is the process of finding unusual data items. One standard approach is to cluster the data and then look at clusters with very few items, or at items that are far away from their cluster mean/average. Unfortunately, in … Continue reading

Posted in Machine Learning, PyTorch | Leave a comment