AI in Action

A Reference for Artificial Intelligence

A rigorous, implementation-first reference for modern artificial intelligence: foundations, machine learning, deep learning, large language models, retrieval-augmented generation, and AI agents, taught with mathematics and runnable Python.
Author

Mike Nguyen

Published

November 18, 2025

Preface

AI in Action

Cover Image

This book is about building artificial intelligence systems from the ground up, with Python as the working language and mathematics as the organizing principle. It is written for readers who do not want to treat AI as a collection of software recipes, but as a coherent set of models, algorithms, and implementation techniques that can be understood, analyzed, and extended.

Modern AI systems have become deeply integrated into scientific research, industry, and everyday life. Many excellent texts explain the theory behind these systems, and many online resources show how to call high-level libraries. This book aims to bridge those worlds: it stays close to the underlying mathematics while always returning to executable Python code that you can run, modify, and test.

Every chapter follows a consistent pattern:

  1. Introduce a concept at an intuitive and mathematical level.
  2. Derive the core algorithmic ideas step by step.
  3. Implement those ideas in Python, with an emphasis on clarity and correctness.
  4. Analyze the implementation, line by line, connecting back to the math.
  5. Explore variations, practical tricks, and failure modes on realistic data.

The goal is not only that you can reproduce the examples in this book, but that you can read a new paper, understand its ideas, and prototype your own implementation with confidence.

Audience and prerequisites

This book is aimed at advanced undergraduates, graduate students, and practitioners who want a rigorous and implementation-focused view of AI. It assumes that you are comfortable with:

  • Programming in Python, including functions, classes, and basic debugging.
  • Linear algebra (vectors, matrices, eigenvalues, singular value decomposition).
  • Multivariable calculus (gradients, Jacobians, chain rule).
  • Probability and statistics (random variables, expectation, variance, basic distributions).
  • Elementary algorithms and data structures.

You do not need to be an expert in all these areas. Each part of the book recalls the essential mathematical ideas just before they are needed, and the Python implementations are written to be as readable as possible. However, you should expect to move frequently between formulas, code, and experiments.

If you are missing some background, you may still find the book useful as a roadmap: the structure of the derivations and the code can help you identify which mathematical tools to review and how they are actually used in practice.

Reproducibility and environment

Reproducibility is central to scientific and engineering practice. All code examples are written to be deterministic given a fixed environment and random seed, subject to the usual limitations of floating-point arithmetic and parallel computation.

Where appropriate, chapters will include short notes on installation, data access, and environment configuration. Nevertheless, the central focus remains on understanding models and algorithms, not on the idiosyncrasies of any one software stack.

Acknowledgments

No book on a subject as broad and fast-moving as AI is the work of a single person. This text owes a substantial intellectual debt to the many researchers, educators, and practitioners who have shaped the field through their papers, lectures, open source software, and critical discussions.

You are encouraged to view this book as part of a larger conversation. The references at the end of each chapter point to classic and contemporary sources that have influenced the presentation here. They are also an invitation to read more widely, compare perspectives, and form your own view of what AI is and where it is going.

Most importantly, the book is intended to be a practical tool for your own work. If, after reading it, you find that you can take a new idea from a paper or a conversation, reason through its implications, and implement a working prototype in Python, then it will have achieved its central purpose.