Grokking Artificial Intelligence Algorithms

Book description

Grokking Artificial Intelligence Algorithms is a fully-illustrated and interactive tutorial guide to the different approaches and algorithms that underpin AI. Written in simple language and with lots of visual references and hands-on examples, you'll learn the concepts, terminology, and theory you need to effectively incorporate AI algorithms into your applications. And to make sure you truly grok as you go, you'll use each algorithm in practice with creative coding exercises—including building a maze puzzle game, performing diamond data analysis, and even exploring drone material optimization.

About the Technology
Artificial intelligence touches every part of our lives. It powers our shopping and TV recommendations; it informs our medical diagnoses. Embracing this new world means mastering the core algorithms at the heart of AI.

About the Book
Grokking Artificial Intelligence Algorithms uses illustrations, exercises, and jargon-free explanations to teach fundamental AI concepts. All you need is the algebra you remember from high school math class. Explore coding challenges like detect­ing bank fraud, creating artistic masterpieces, and setting a self-driving car in motion.

What's Inside
  • Use cases for different AI algorithms
  • Intelligent search for decision making
  • Biologically inspired algorithms
  • Machine learning and neural networks
  • Reinforcement learning to build a better robot


About the Reader
For software developers with high school–level algebra and calculus skills.

About the Author
Rishal Hurbans is a technologist, founder, and international speaker.

Quotes
From start to finish, the best book to help you learn AI algorithms and recall why and how you use them.
- Linda Ristevski, York Region District School Board

This book takes an impossibly broad area of computer science and communicates what working developers need to understand in a clear and thorough way.
- David Jacobs, Product Advance Local

The most comprehensive content I have seen on AI algorithms.
- Karan Nih, Classic Software Solutions

This book removes the fear of stepping into the mechanics of AI.
- Kyle Peterson, University of Iowa Athletics

Publisher resources

View/Submit Errata

Table of contents

  1. Copyright
  2. contents
  3. dedication
  4. preface
    1. Our obsession with technology and automation
    2. Ethics, legal matters, and our responsibility
      1. Intention and impact: Understanding your vision and goals
      2. Unintended use: Protecting against malicious use
      3. Unintended bias: Building solutions for everyone
      4. The law, privacy, and consent: Knowing the importance of core values
      5. Singularity: Exploring the unknown
    3. acknowledgments
    4. about this book
      1. Who should read this book
      2. How this book is organized: A roadmap
      3. About the Code
      4. liveBook discussion forum
      5. Other online resources
    5. about the author
  5. 1 Intuition of artificial intelligence
    1. What is artificial intelligence?
      1. Defining AI
      2. Understanding that data is core to AI algorithms
      3. Viewing algorithms as instructions in recipes
    2. A brief history of artificial intelligence
    3. Problem types and problem-solving paradigms
      1. Search problems: Find a path to a solution
      2. Optimization problems: Find a good solution
      3. Prediction and classification problems: Learn from patterns in data
      4. Clustering problems: Identify patterns in data
      5. Deterministic models: Same result each time it’s calculated
      6. Stochastic/probabilistic models: Potentially different result each time it’s calculated
    4. Intuition of artificial intelligence concepts
      1. Narrow intelligence: Specific-purpose solutions
      2. General intelligence: Humanlike solutions
      3. Super intelligence: The great unknown
      4. Old AI and new AI
      5. Search algorithms
      6. Biology-inspired algorithms
      7. Machine learning algorithms
      8. Deep learning algorithms
    5. Uses for artificial intelligence algorithms
      1. Agriculture: Optimal plant growth
      2. Banking: Fraud detection
      3. Cybersecurity: Attack detection and handling
      4. Health care: Diagnosis of patients
      5. Logistics: Routing and optimization
      6. Telecoms: Optimizing networks
      7. Games: Creating AI agents
      8. Art: Creating masterpieces
    6. Summary of Intuition of artificial intelligence
  6. 2 Search fundamentals
    1. What are planning and searching?
    2. Cost of computation: The reason for smart algorithms
    3. Problems applicable to searching algorithms
    4. Representing state: Creating a framework to represent problem spaces and solutions
      1. Graphs: Representing search problems and solutions
      2. Representing a graph as a concrete data structure
        1. Exercise: Represent a Graph as a Matrix
        2. Solution: Represent a Graph as a Matrix
      3. Trees: The concrete structures used to represent search solutions
    5. Uninformed search: Looking blindly for solutions
    6. Breadth-first search: Looking wide before looking deep
      1. Exercise: Determine the path to the solution
      2. Solution: Determine the path to the solution
    7. Depth-first search: Looking deep before looking wide
      1. Exercise: Determine the path to the solution
      2. Solution: Determine the path to the solution
    8. Use cases for uninformed search algorithms
    9. Optional: More about graph categories
    10. Optional: More ways to represent graphs
      1. Incidence matrix
      2. Adjacency list
    11. Summary of search fundamentals
  7. 3 Intelligent search
    1. Defining heuristics: Designing educated guesses
      1. Thought Experiment: Given the following scenario, what heuristic can you imagine?
      2. Thought Experiment: Possible solution
    2. Informed search: Looking for solutions with guidance
      1. A* search
      2. Use cases for informed search algorithms
    3. Adversarial search: Looking for solutions in a changing environment
      1. A simple adversarial problem
      2. Min-max search: Simulate actions and choose the best future
        1. Heuristics
        2. Exercise: What values would propagate in the following Min-max tree?
        3. Solution: What values would propagate in the following Min-max tree?
      3. Alpha-beta pruning: Optimize by exploring the sensible paths only
      4. Use cases for adversarial search algorithms
    4. Summary of Intelligent search
  8. 4 Evolutionary algorithms
    1. What is evolution?
    2. Problems applicable to evolutionary algorithms
    3. Genetic algorithm: Life cycle
    4. Encoding the solution spaces
      1. Binary encoding: Representing possible solutions with zeros and ones
        1. Exercise: What is a possible encoding for the following problem?
        2. Solution: What is a possible encoding for the following problem?
    5. Creating a population of solutions
    6. Measuring fitness of individuals in a population
    7. Selecting parents based on their fitness
      1. Steady state: Replacing a portion of the population each generation
      2. Generational: Replacing the entire population each generation
      3. Roulette wheel: Selecting parents and surviving individuals
    8. Reproducing individuals from parents
      1. Single-point crossover: Inheriting one part from each parent
      2. Two-point crossover: Inheriting more parts from each parent
      3. Uniform crossover: Inheriting many parts from each parent
        1. Exercise: What outcome would uniform crossover generate for these chromosomes?
        2. Solution: What outcome would uniform crossover generate for these chromosomes?
      4. Bit-string mutation for binary encoding
      5. Flip-bit mutation for binary encoding
    9. Populating the next generation
      1. Exploration vs. exploitation
      2. Stopping conditions
    10. Configuring the parameters of a genetic algorithm
    11. Use cases for evolutionary algorithms
    12. Summary of evolutionary algorithms
  9. 5 Advanced evolutionary approaches
    1. Evolutionary algorithm life cycle
    2. Alternative selection strategies
      1. Rank selection: Even the playing field
      2. Tournament selection: Let them fight
      3. Elitism selection: Choose only the best
    3. Real-value encoding: Working with real numbers
      1. Real-value encoding at its core
      2. Arithmetic crossover: Reproduce with math
      3. Boundary mutation
      4. Arithmetic mutation
    4. Order encoding: Working with sequences
      1. Importance of the fitness function
      2. Order encoding at its core
      3. Order mutation: Order/permutation encoding
    5. Tree encoding: Working with hierarchies
      1. Tree encoding at its core
      2. Tree crossover: Inheriting portions of a tree
      3. Change node mutation: Changing the value of a node
    6. Common types of evolutionary algorithms
      1. Genetic programming
      2. Evolutionary programming
    7. Glossary of evolutionary algorithm terms
    8. More use cases for evolutionary algorithms
    9. Summary of advanced evolutionary approaches
  10. 6 Swarm intelligence: Ants
    1. What is swarm intelligence?
    2. Problems applicable to ant colony optimization
      1. Exercise: Find the shortest path in this carnival configuration by hand
      2. Solution: Find the shortest path in this carnival configuration by hand
    3. Representing state: What do paths and ants look like?
    4. The ant colony optimization algorithm life cycle
      1. Initialize the pheromone trails
      2. Set up the population of ants
      3. Choose the next visit for each ant
        1. The stochastic nature of ants
        2. Selecting destination based on a heuristic
        3. Exercise: Determine the probabilities of visiting the attractions with the following information
        4. Solution: Determine the probabilities of visiting the attractions with the following information
      4. Update the pheromone trails
        1. Updating pheromones due to evaporation
        2. Updating pheromones based on ant tours
        3. Exercise: Calculate the pheromone update given the following scenario
        4. Solution: Calculate the pheromone update given the following scenario
      5. Update the best solution
      6. Determine the stopping criteria
    5. Use cases for ant colony optimization algorithms
    6. Summary of ant colony optimization
  11. 7 Swarm intelligence: Particles
    1. What is particle swarm optimization?
    2. Optimization problems: A slightly more technical perspective
      1. Exercise: How many dimensions will the search space for the following scenario be?
      2. Solution: How many dimensions will the search space for the following scenario be?
    3. Problems applicable to particle swarm optimization
    4. Representing state: What do particles look like?
    5. Particle swarm optimization life cycle
      1. Initialize the population of particles
      2. Calculate the fitness of each particle
        1. Exercise: What would the fitness be for the following inputs given the drone fitness function?
        2. Solution: What would the fitness be for the following inputs given the drone fitness function?
      3. Update the position of each particle
        1. The components of updating velocity
        2. Updating velocity
        3. Position update
        4. Exercise: Calculate the new velocity and position for particle 1 given the following information about the particles
        5. Solution: Calculate the new velocity and position for particle 1 given the following information about the particles
      4. Determine the stopping criteria
    6. Use cases for particle swarm optimization algorithms
    7. Summary of particle swarm optimization
  12. 8 Machine learning
    1. What is machine learning?
    2. Problems applicable to machine learning
      1. Supervised learning
      2. Unsupervised learning
      3. Reinforcement learning
    3. A machine learning workflow
      1. Collecting and understanding data: Know your context
      2. Preparing data: Clean and wrangle
        1. Missing data
        2. Ambiguous values
        3. Encoding categorical data
        4. Exercise: Identify and fix the problem data in this example
        5. Solution: Identify and fix the problem data in this example
        6. Testing and training data
      3. Training a model: Predict with linear regression
        1. Fitting a line to the data
        2. Finding the mean of the features
        3. Finding regression lines with the least-squares method
        4. Exercise: Calculate a regression line using the least-squares method
        5. Solution: Calculate a regression line using the least-squares method
      4. Testing the model: Determine the accuracy of the model
        1. Separating training and testing data
        2. Measuring the performance of the line
      5. Improving accuracy
    4. Classification with decision trees
      1. Classification problems: Either this or that
        1. Exercise: Regression vs. Classification
        2. Solution: Regression vs. Classification
      2. The basics of decision trees
      3. Training decision trees
        1. Data structures for decision trees
        2. Decision-tree learning life cycle
        3. Exercise: Calculating uncertainty and information gain for a question
        4. Solution: Calculating uncertainty and information gain for a question
      4. Classifying examples with decision trees
    5. Other popular machine learning algorithms
    6. Use cases for machine learning algorithms
    7. Summary of machine learning
  13. 9 Artificial neural networks
    1. What are artificial neural networks?
    2. The Perceptron: A representation of a neuron
      1. Exercise: Calculate the output of the following input for the Perceptron
      2. Solution: Calculate the output of the following input for the Perceptron
    3. Defining artificial neural networks
    4. Forward propagation: Using a trained ANN
      1. Exercise: Calculate the prediction for the example BY using forward propagation with the following ANN
      2. Solution: Calculate the prediction for the example BY using forward propagation with the following ANN
    5. Backpropagation: Training an ANN
      1. Phase A: Setup
      2. Phase B: Forward propagation
      3. Phase C: Training
        1. Exercise: Calculate the new weights for the highlighted weights
        2. Solution: Calculate the new weights for the highlighted weights
    6. Options for activation functions
    7. Designing artificial neural networks
      1. Inputs and outputs
      2. Hidden layers and nodes
      3. Weights
      4. Bias
      5. Activation functions
      6. Cost function and learning rate
    8. Artificial neural network types and use cases
      1. Convolutional neural network
      2. Recurrent neural network
      3. Generative adversarial network
    9. Summary of artificial neural networks
  14. 10 Reinforcement learning with Q-learning
    1. What is reinforcement learning?
      1. The inspiration for reinforcement learning
    2. Problems applicable to reinforcement learning
    3. The life cycle of reinforcement learning
      1. Simulation and data: Make the environment come alive
      2. Training with the simulation using Q-learning
        1. Exercise: Calculate the change in values for the Q-table
        2. Solution: Calculate the change in values for the Q-table
      3. Testing with the simulation and Q-table
      4. Measuring the performance of training
      5. Model-free and model-based learning
    4. Deep learning approaches to reinforcement learning
    5. Use cases for reinforcement learning
      1. Robotics
      2. Recommendation engines
      3. Financial trading
      4. Game playing
    6. Summary of reinforcement learning
  15. index
  16. RELATED MANNING TITLES

Product information

  • Title: Grokking Artificial Intelligence Algorithms
  • Author(s): Rishal Hurbans
  • Release date: August 2020
  • Publisher(s): Manning Publications
  • ISBN: 9781617296185