Book Notes: AI and Machine Learning for Coders - A Programmer's Guide to Artificial Intelligence
Overview
This post contains my notes on the book AI and Machine Learning for Coders - A Programmer’s Guide to Artificial Intelligence by Laurence Moroney[^1]. The book is a practical guide to building AI and machine learning applications using TensorFlow and Keras. It covers the basics of machine learning, deep learning, and neural networks, and provides hands-on examples of how to build and deploy AI applications.
You can find the book on Amazon
I’ll be adding my notes to this post as I read through the book. The notes will be organized by chapter and will include key concepts, code examples, and any additional insights I find useful.
Chapter 1: Introduction to tensorflow
In chapter 1 you’ll learn about the limitations of traditional programming and get some initial insight into Machine Learning. You’ll learn how to install tensorflow, in my case on a M2 Mac.
I searched around a little to see what common issues occurred for mac installations and came across a handy blog that covered different tensorflow installation options and included a handy script to verify tensorflow was indeed using my gpu. After a brief hiccup I added the following packages to my installation, re-ran the script and was on my way.
pip install tensorflow
pip install tensorflow-macos tensorflow-metal
At the end of this chapter you’ll build and train your first model, a simple linear regression model that predicts the output of a linear equation.
Note: Using the coding samples located in GitHub will make following along really easy. https://github.com/lmoroney/tfbook
Chapter 2: Introduction to Computer Vision
Using the Fashion MNIST dataset, chapter 2 introduces the reader to Neural Network design. Using a real, but simiple dataset, you’ll learn how to build a neural network that can classify images of clothing.
Chapter 3: Convolutional Neural Networks
In chapter three, you’ll explore Convolutional Neural Networks using images of humans and horses. You’ll use training and validation data to build up a model as well as learn about image augmentation to broaden the data and reduce overspecialization. Additional concepts introduced include Transferred Learning, Multiclass Classification, and Dropout Regularization.
Chapter 4: Using Public Datasets with TensorFlow Datasets
Using the TensorFlow Datasets library, chapter 4 introduces the reader to ETL which is a core pattern for training data. The chapter covers a practical example as well as how to use parallelization ETL to speed up the process.
Chapter 5: Natural Language Processing
Chapter 5 introduces the reader to tokenization, taking text and breaking it down into smaller units (tokens) for processing. It covers basics like Turning sentences into tokens, padding sequences, as well as more advanced techniques like removing stop words, and text cleaning.
The examples in this chapter use the IMDB, emotional sentiment, and scarcasim classification datasets as examples for building datasets from html like data, csv files, and json.
Taxonomy
- Overfitting: When the model becomes overspecialized to the training data.
- Convolution: Mathematical filter that works on the pixels of an image.
- Transfer Learning: Taking layers from another architecture.
- Natural Language Processing (NLP): A field of AI that focuses on the interaction between computers and humans through natural language.
- Tokenization: The process of breaking down text into smaller units (tokens) for processing.
- Padding: Adding zeros to the beginning or end of a sequence to make it a fixed length.
- Out of Vocabulary (OOV): Words that are not present in the training vocabulary.
- Stop Words: Common words that are often removed from text data to reduce noise and improve model performance.