by Lukas Cao
Special thanks to my friend, Aiden Choe, for helping me edit this book.
AI (Artificial Intelligence) is changing the landscape of multiple industries as we know it. In recent examples, AI has been used to save scientists an immense amount of time during the COVID-19 pandemic, producing a global impact. But what if you could build your own AI to do your homework, chores, or even just act as a personal companion when you are lonely?
This book is aimed towards high schoolers so that you can begin building your own AI. Most of the important concepts used in AI are based on calculus. However, calculus was built on algebra. As a result, this book brings any calculus concepts used in AI down to algebra, which is more familiar to high schoolers.
This book uses Python for writing the code and since AI is a broad subject, I have narrowed down this book to an introduction to artificial neural networks which have become very popular in the last few years.
- Learn the structure of artificial neural networks
- Learn how to train artificial neural networks
- Create your own artificial neural networks for your own use
- Understand the math (algebra) behind training artificial neural networks without knowledge of calculus
- Familiarize yourself with NumPy, Pandas, and Matplotlib
Click on the "View On Github" button here or above to access the Github repository.
There you can find folders for each chapter. Each folder for the chapter contains a PDF of the chapter and a folder that contains Python code for the chapter. The book starts at Chapter 00 and Chapter 10 is the last chapter. The book has a total of 230 pages so in 2-3 months you will be able to make your own neural networks! The table of contents for the book is below. Happy reading! 😀
If this book was helpful for you or anyone else, please give it a star ⭐️ on Github (make sure you have an account first). By giving this book a star ⭐️ on Github you are supporting the author and helping this book gain popularity. Also, please share this book on social media and share the link (https://ohhh25.github.io/ai-book/) to anyone you think may benefit from this book or anyone you think is interested in AI or want to understand how AI works.
If you would like to support me, please buy the ebook on Amazon: https://www.amazon.com/dp/B0BGFRTB4M. I would greaty appreciate you to rate and comment a review on the Amazon page to help others discover my book. Thank you very much! 😀
Chapter 00| Basics of Neural Networks
- Overview of AI and its Parts
- Connecting Biological Neural Networks to Artificial Neural Networks
- Steps for Artificial Neural Network
- Basic Application of an Artificial Neural Network to Help Concepts “Sink In” Faster
Chapter 01| Simple Artificial Neural Network Architecture
- Scalars, Vectors, and Matrices
- What “goes on” inside one Artificial Neuron?
- What “goes on” inside one layer of Artificial Neurons?
- Virtual layer (object) of Artificial Neurons
Chapter 02| Step #1 of Training: Defining Error
- Why do we need to Define a Metric for Error?
- Metrics for Error (Cost Functions)
Chapter 03| Possible Error Reduction Methods
- Random, Random, Random!
- Random Updates!
Chapter 04| Gradient Descent: The Perfect Algorithm To Use In Training
- Connection Of Hill To Cost Function & Using Slope at a Point (derivative) to determine Update Direction
- Numerical Derivative
- Calculus Chain Rule for High Schoolers
- Cost Function Backward Method (Analytical Derivative)
- Dense Layer Backward Method (Analytical Derivative)
Chapter 05| Stochastic Gradient Descent & Learning Rate
- Gradient Descent Without Learning Rate
- Gradient Descent With Learning Rate
- Limitations of SGD
Chapter 06| Other Types of Optimizers
- Momentum
- Root Mean Square Propagation (RMSProp)
- Learning Rate Decay
- Adaptive Momentum (Adam)
- Hyperparameter Tuning
Chapter 07| Linear Regression Application
- Dataset Download
- Data Setup
- Training
- Normalization
- Standardization
- Linear Regression Is Not Good Enough!
- Higher-Order Polynomial Regression Is Better than Linear Regression!
Chapter 08| Actual Neural Networks
- Problem With Just Simply Stacking Dense Layers On Top of Each Other
- Solution to Making Neural Networks Actually Work: Activation Functions
- Neural Network Architecture
- ReLU Activation Function & Dense Layer Backward Modification
- Finally Training An Actual Neural Network (One Hidden Layer)
- Neural Networks with Multiple Hidden Layers
Chapter 09| Binary Classification
- Introduction to Classification
- Dataset Download
- Training Setup & Initial Training
- Checking the Model’s Reliability
- Regularization
- Dropout
Chapter 10| Multi-Class Classification
- Structure of Datasets
- Softmax Activation Function
- Categorical Cross Entropy Cost
- Dataset & Setup
- Mini-Batch Gradient Descent
- Saving/Loading Models
- I have successfully completed Coursera's Machine Learning Course from Stanford University's Stanford Online Program (certificate available for viewing here).
- I have already taken AP Calculus AB with an exam score of a 5 (with a solid understanding of calculus, I can easily bring calculus concepts used in AI down to algebra).
- I am a high schooler so I know exactly which math concepts high schoolers know and which math concepts need to be brought down to algebra level.
- This book is an open source format, meaning...its free! There is no fee to learn! Cancel your commitment anytime!
There are many other books on AI that may even convey the same information better than this one. However, I would like to inform you that understanding AI is NOT friendly to high schoolers. Many online courses and other books bring in mind-boggling math equations that high schoolers cannot easily comprehend. The result? You may end up to quit learning AI because you doubt that you have the capability but you will be unable to enjoy creating your own AI. Unfortunately I had a friend that went through this experience.
In order for future high schoolers to successfully learn AI, this book will attempt to convert AI, a "non-high-schooler friendly” subject, to a “high-schooler friendly” subject. How? By getting rid of as much of the messy math that is beyond high school as possible. For example, take the happy y = mx + b equation from your Algebra 1 class or Math 1 class (mangeable level of mathematics). That equation is the absolute drive of AI, without it, there is no AI and you will soon understand why. Instead of directly teaching you the linear algebra to use the y = mx + b equation, we teach it indirectly.
I first got into AI because I thought it was unbelievable how you can give a machine an image and it will somehow recognize the type of object presented. The most impressive breakthrough that got me excited about this field was when a machine beat a human in the game Go. How could a machine, that spent considerably less time to learn the game, gain enough knowledge about its strategies to beat a champion?
My father, who works with AI himself by programming robots, initiated my journey into AI and I still enjoy learning more complex AI and working on AI projects.
After my sixth grade year he asked me if I wanted to make a website. It was very sudden, but I agreed because I would learn how the “cool guys” (programmers) make websites with their coding skills. This wasn't related to AI, but that was the first time I dipped my feet into the field of computer science and started programming. Later sometime during my junior-high years, I started learning Python. Though I quit the first time due to its difficulty, I pushed through the second time.
It was the summer of my freshman year at high school when my father suggested me to start a project on AI and self-driving cars was my number one pick. The problem was, I did not know anything about making AI and ended up going on Github to copy and paste other people’s work, hoping it would work for me. Unfortunately for me, it wasn't that simple, and I didn’t understand much of the README files and their steps,leading to several errors.
Skip ahead a few weeks and I finally got one car to detect lane lines, but I didn’t feel that great; I didn’t understand what I did at all. It did not feel like a personal achievement, and I felt empty as if I cheated on a test to get an A. I felt no desire for celebration of my achievement because there was no hard work done by me. I took the shortcut that wouldn't offer long-term benefits.
Therefore, I decided to actually begin learning AI. On Coursera, I found an 11-week course on Machine Learning taught by Andrew Ng, former Stanford University Professor, which I enrolled in mid-August. The course was clearly meant for calculus students so I struggled with the equations, but I persevered; and now, it has brought me to where I am right now, writing a book for other high schoolers to help them understand AI without going through an online class with messy, confusing math equations.
Hopefully you will enjoy this book to save yourself a lot of time in taking another step into the field of AI. I will try my best to convey the concepts in a different but relatable way to make understanding as easy as possible. Most importantly, I will bring calculus back down to the level of algebra (a high schooler’s math level). I hope you will enjoy this book! Thank you for reading.
Python Version Used: 3.9.7
Matplotlib -- https://pypi.org/project/matplotlib/
Numpy -- https://pypi.org/project/numpy/
Pandas -- https://pypi.org/project/pandas/
Matplotlib -- 3.4.0
Numpy -- 1.22.2
Pandas -- 1.4.0