Category Archives: Keras

Defining a Keras Model Using a Python Class

The most common way to define a simple Keras neural network network/model is to just crank it out as a sequence of Dense layers. For example, to create a 4-5-3 network for the Iris Dataset where the labels are already … Continue reading

Posted in Keras | Leave a comment

Keras Autoencoder Dimensionality Reduction for UCI Digits Visualization

One Sunday morning, after I walked my dogs, I decided to code up an example of using a Keras library autoencoder for dimensionality reduction for visualization of the UCI Digits dataset. The UCI Digits dataset consists of crude 8×8 images … Continue reading

Posted in Keras | Leave a comment

Time Series Classification Using a Keras Transformer Model

Deep neural systems based on Transformer Architecture (TA, also called multi-headed attention models) have revolutionized natural language processing (NLP). TA systems were designed to deal with sequence-to-sequence problems, such as translating English text to German text. TA systems can also … Continue reading

Posted in Keras | Leave a comment

Ordinal Classification Using Keras

An ordinal classification problem (confusingly, also called ordinal regression) is one where the goal is to predict a class label in situations where the labels have an ordering. For example, you might want to predict the price of a house, … Continue reading

Posted in Keras | Leave a comment

Yet Another MNIST Example Using Keras

It’s a major challenge to keep up with the continuous changes to the Keras/TensorFlow neural code library (and the PyTorch library too). I recently upgraded my Keras installation to version 2.6 and so I’m going through all my standard examples … Continue reading

Posted in Keras | 1 Comment

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

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

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

Converting MNIST Binary Files to Text Files

PyTorch and Keras/TensorFlow have built-in ways to load the MNIST dataset into memory, but in many situations you just want MNIST data as simple text files. Source MNIST data files are in a proprietary binary format, so if you want … Continue reading

Posted in Keras, Machine Learning, PyTorch | Leave a comment

Installing Keras on Windows – January 2021

I’m a big fan of both the Keras and PyTorch neural network libraries. I tend to use one library for several months, and then switch to the other for several months, depending on the project I’m working on. It’s possible, … Continue reading

Posted in Keras, Machine Learning, PyTorch | Leave a comment