A Dev's Intro

To Artificial Intelligence

Barry S. Stahl

Solution Architect & Developer

@bsstahl@cognitiveinheritance.com

https://CognitiveInheritance.com

Transparent Half Width Image.png

Favorite Physicists & Mathematicians

Favorite Physicists

  1. Harold "Hal" Stahl
  2. Carl Sagan
  3. Richard Feynman
  4. Marie Curie
  5. Nikola Tesla
  6. Albert Einstein
  7. Neil Degrasse Tyson
  8. Niels Bohr
  9. Galileo Galilei
  10. Michael Faraday

Other notables: Stephen Hawking, Edwin Hubble

Favorite Mathematicians

  1. Ada Lovelace
  2. Alan Turing
  3. Johannes Kepler
  4. Rene Descartes
  5. Isaac Newton
  6. Leonardo Fibonacci
  7. George Boole
  8. Blaise Pascal
  9. Johann Gauss
  10. Grace Hopper

Other notables: Daphne Koller, Benoit Mandelbrot

Some OSS Projects I Run

  1. Liquid Victor : Media tracking and aggregation [used to assemble this presentation]
  2. Prehensile Pony-Tail : A static site generator built in c#
  3. TestHelperExtensions : A set of extension methods helpful when building unit tests
  4. Conference Scheduler : A conference schedule optimizer
  5. IntentBot - A microservices framework for creating conversational bots on top of Bot Framework
  6. LiquidNun : Library of abstractions and implementations for loosely-coupled applications
  7. Toastmasters Agenda : A c# library and website for generating agenda's for Toastmasters meetings

http://GiveCamp.org

GiveCamp.png

Artificial Intelligence

A Computational System that Behaves Rationally

Rationality

A system is rational if it attempts to make the best possible decision​ based on the best available understanding of the problem (model)​ and of the state of the domain (data)​.

Intelligent Agents

Intelligent Agents - Various Techniques.png

Types of AI Models

  • Logic​al - Reducible to conditionals​

    • Object Oriented​

    • Rules Engine

  • Search/Optimization - Reduce and Search the Solution Space

    • Dynamic Programming​

    • Linear Programming

  • Probabilistic/Learning - Predicts best solution from earlier data

    • Neural/Bayesian Networks

    • Genetic Algorithms

Search/Optimization Models

george-bernard-dantzig.jpg

George Dantzig - Creator of the Simplex Algorithm

Use Case: Production Targets

  • Products​
    • Small Vase​
      • 1 oz. clay, 1 oz. glaze​
      • Sells for $3.00 each​
    • Large Vase​
      • 4 oz. clay, 2 oz. glaze​
      • Sells for $9.00 each​
  • Inventory​
    • Clay - 24 oz.​
    • Glaze - 16 oz.​
  • Goal
    • Maximize Revenue

Solution Space

Solution Space Graph - With Feasible Solutions.png

Constraint Equations

  • Clay Constraint
    • X + 4Y <= 24 ​
      • X <= 24 and Y <= 6​
  • Glaze Constraint
    • X + 2Y <= 16​
      • X <=16 and Y <= 8

Feasible Region

Solution Space Graph - With Feasible Solutions and Constraint Lines.png

Linear Programming - Polytope

Solution Space Graph - With Polytope.png

Linear and Mixed-Integer Programming

  • Define Constraints that the Solution Must Satisfy​
    • Use these constraints to limit the search space​
      • More constraints = smaller search space
        • Solutions that exist are found faster
        • May not find a feasible solution
  • Add an Objective Function to Improve Solutions​
    • All constraints must be satisfied first​
    • Objectives are a goal relative to an equation​
      • i.e. Maximize revenue where r = 3X + 9Y

Feasibility Problems

  • Find the best values for a set of decision variables that
    • Satisfies all constraints

Optimization Problems

  • Find the best values for a set of decision variables that​
    • Satisfies all constraints
    • Maximizes the features we want​
    • Minimizes the features we don’t want

Regression Analysis

Carl_Friedrich_Gauss_Smaller.jpg

Carl Friedrich Gauss

Use Case: Location Inference

Predict the location of a train on a rail​

  • Moves in 1-dimensional space​
  • Movement is approximately consistent​
  • Sensors periodically detect the train​
    • Report location and time of detection​
    • Sensors are disconnected – report only periodically​
    • Sensor accuracy < 100%

Linear Data

Positive Only Linear Data.png

Linear Trend

Positive Only Linear Data with Trendline.png

Linear Regression Model

Predict the unknown values in a linear equation​

  • Given X (time), predict Y (location)​
    • Y = mX + b​
  • Find the best values for m and b
    • Minimize total error
Regression Model.png

Neural Networks

  • Create a model to predict desired values​
    • Determine needed outputs
    • Define available inputs
    • Setup appropriate hidden layers
  • "Learn" values for the model that minimize errors​
  • Use learned values to predict unknowns

Deep Neural Networks

marvin-minsky.jpg

Marvin Minsky - AI Pioneer

Use Case: Image Classification

Canis Latrans - Small.jpg

Predict if an image is "interesting" or not

Deep Neural Networks

DNN.png

Convolutional Neural Networks

CNN.png

What is a Convolution?

Convolutions.png

When used in image processing a Convolution identifies a feature in a portion of an image

  • Image is "scanned" for the presence of the feature
  • Feature detections are mapped to a smaller grid
  • Feature Grids become inputs for a DNN

Other "Learning" Models

Daphne-Koller.jpg

Daphne Koller - Pioneer in Probabilistic Reasoning

Use Case: Find the Best Strategy

Find the best strategy in a multi-player board game​

  • Variant of Chutes & Ladders​
    • Player decides whether or not to take a chute or ladder​
  • Extremely large Solution Space
    • Impossible to simply try all options

Genetic Algorithms

Simulate Darwinian Evolution​

  • Each candidate solution is defined by its properties (chromosomes)​
  • A fitness function is used to determine which solutions "survive"
  • Surviving solutions may mutate and evolve other solutions​
  • Optimality is never guaranteed

DNA of Chutes & Ladders

DNA.png

Genetic Algorithm

Genetic Algorithm.png

Summary

Artificial Intelligence is about making automated decisions​

  • Logical methods reduce the problem to conditionals​
    • Object Oriented​
    • Rules Engine​
  • Search/Optimization methods - reducing and searching the solution space​
    • Dynamic Programming​
    • Linear Programming​
  • Probabilistic/Learning methods result in a prediction derived from earlier data​
    • Neural/Bayesian Networks​
    • Genetic Algorithms

Resources