Author Archives: jamesdmccaffrey

Banknote Authentication Example Using Keras

I recently upgraded my Keras library installation to version 2.6 and so I’ve been revisiting my three basic examples: Iris Dataset (multi-class classification), Boston Housing (regression), and Banknote Authentication (binary classification). In older versions of Keras, you would install the … Continue reading

Posted in Keras | Leave a comment

Example of a PyTorch Custom Layer

When I create neural software systems, I most often use the PyTorch library. The Keras library is very good for basic neural systems but for advanced architectures I like the flexibility of PyTorch. Using raw TensorFlow without Keras is an … Continue reading

Posted in PyTorch | Leave a comment

Computing Model Accuracy for Keras Regression Models

I recently upgraded my Keras neural network code library version to 2.6.0 and decided to revisit my three basic examples — Iris (multi-class classification), Banknote (binary classification), and Boston (regression). This morning I refactored my Boston example. Even though it … Continue reading

Posted in Keras | Leave a comment

Another Set of Beautiful Machine Learning Visualizations from Thorsten Kleppe

Thorsten Kleppe is a fellow machine learning enthusiast who creates beautiful ML visualizations. Thorsten sent me some of his latest work. Thorsten’s new visualizations are based on a logistic regression model applied to the MNIST dataset. The MNIST dataset contains … Continue reading

Posted in Machine Learning | 1 Comment

An Example of a Bayesian Neural Network Using PyTorch

A regular neural network has a set of numeric constants called weights which determine the network output. If you feed the same input to a regular trained neural network, you will get the same output every time. In a Bayesian … Continue reading

Posted in PyTorch | Leave a comment

A Quick Look at Azure Functions

I was working on a project that uses Azure Functions. An Azure Function is an example of (the wildly misnamed) “serverless technology”. An Azure Function lives in the Cloud, accepts HTTP requests, and gives an HTTP response. I hadn’t used … Continue reading

Posted in Miscellaneous | Leave a comment

Installing Keras 2.6 on Windows and Running the Iris Example

One of the biggest challenges in machine learning is staying up to date with new releases of code libraries. I noticed that Keras released a new version 2.6 a few days ago so I figured I’d do a complete end-to-end … Continue reading

Posted in Keras | Leave a comment

Wasserstein Distance Using C# and Python in Visual Studio Magazine

I wrote an article titled “Wasserstein Distance Using C# and Python” in the August 2021 edition of Microsoft Visual Studio Magazine. See https://visualstudiomagazine.com/articles/2021/08/16/wasserstein-distance.aspx. There are many different ways to measure the distance between two probability distributions. Some of the most … Continue reading

Posted in Machine Learning | Leave a comment

NFL 2021 Week 1 Super Early Predictions – Zoltar Likes Four Underdogs

Zoltar is my NFL football prediction computer program. It uses reinforcement learning and a neural network. Here are Zoltar’s very early, preliminary predictions for week #1 of the 2021 season. I’ll re-run Zoltar again, closer to the start of the … Continue reading

Posted in Zoltar | Leave a comment

Comparing Wasserstein Distance with Kullback-Leibler Distance

There are many ways to calculate the distance between two probability distributions. Four of the most common are Kullback-Leibler (KL), Jensen-Shannon (JS), Hellinger (H), and Wasserstein (W). When I was in school, I learned that W was superior to KL, … Continue reading

Posted in Machine Learning | Leave a comment