Author Archives: jamesdmccaffrey

Printing Serialized Matrices

When I’m writing code, I often run into mini-problems that are somewhat interesting, even if they’re not important in the overall scheme of things. I was working with neural networks. A 4-5-3 NN (4 input nodes, 5 hidden nodes, 3 … Continue reading

Posted in Machine Learning, Miscellaneous | Leave a comment

Sentiment Analysis and the GloVe Word Embedding Data

When I do machine learning with natural language problems, I usually use the gensim system to convert words (like “the”) into a vector of values (like [0.1234, 0.2345, . . ]). The key idea is that neural systems only understand … Continue reading

Posted in Keras, Machine Learning | Leave a comment

I Give a Talk on Back-Propagation

I recently gave a lecture on back-propagation. I’ve spoken on this topic before and it’s always a challenge because back-propagation has many interrelated ideas. Even defining back-propagation is quite tricky because you can think of it in many ways. Back-propagation … Continue reading

Posted in Machine Learning | Leave a comment

IMDB Movie Review Sentiment Analysis using Keras

The IMDB movie review dataset consists of a total of 50,000 movie reviews from ordinary people. Reviews are simple text and can be positive (7 stars or more) or negative (4 stars or fewer). The Keras neural network library documentation … Continue reading

Posted in Keras, Machine Learning | Leave a comment

Introduction to Keras with TensorFlow

I wrote an article titled “Introduction to Keras with TensorFlow” in the May 2018 issue of Visual Studio Magazine. See https://visualstudiomagazine.com/articles/2018/05/01/inroduction-to-keras.aspx. It’s possible to create neural networks from raw code. But there are many code libraries you can use to … Continue reading

Posted in Keras, Machine Learning | Leave a comment

Avoiding an Exception when Calculating Softmax

The softmax of a set of values returns a set of values that sum to 1.0 so they can be interpreted as probabilities. The softmax function is one of the fundamental tools for machine learning. Suppose you have some neural … Continue reading

Posted in Machine Learning | Leave a comment

Betweenness Centrality

Network graphs are interesting data structures. You can compute all kinds of metrics on a graph, including several measures of centrality. Centrality metrics indicate how important a node is in some way. Different centrality measures give you different information. Betweenness … Continue reading

Posted in Miscellaneous | Leave a comment