Playing Tic-Tac-Toe with Neural Networks

Slides:



Advertisements
Similar presentations
Reinforcement Learning
Advertisements

Slides from: Doug Gray, David Poole
Martin Boyd Christopher Hirunthanakorn
Multilayer Perceptrons 1. Overview  Recap of neural network theory  The multi-layered perceptron  Back-propagation  Introduction to training  Uses.
Tetris – Genetic Algorithm Presented by, Jeethan & Jun.
Visualization of hidden node activity in a feed forward neural network Adam Arvay.
Introduction to Artificial Intelligence (G51IAI)
Machine Learning: Connectionist McCulloch-Pitts Neuron Perceptrons Multilayer Networks Support Vector Machines Feedback Networks Hopfield Networks.
Chapter 10 Artificial Intelligence © 2007 Pearson Addison-Wesley. All rights reserved.
Machine Learning CPSC 315 – Programming Studio Spring 2009 Project 2, Lecture 5.
November 9, 2010Neural Networks Lecture 16: Counterpropagation 1 Unsupervised Learning So far, we have only looked at supervised learning, in which an.
September 16, 2010Neural Networks Lecture 4: Models of Neurons and Neural Networks 1 Capabilities of Threshold Neurons By choosing appropriate weights.
(Page 554 – 564) Ping Perez CS 147 Summer 2001 Alternative Parallel Architectures  Dataflow  Systolic arrays  Neural networks.
Machine Learning Motivation for machine learning How to set up a problem How to design a learner Introduce one class of learners (ANN) –Perceptrons –Feed-forward.
A Robust Layered Control System for a Mobile Robot Rodney A. Brooks Presenter: Michael Vidal.
October 7, 2010Neural Networks Lecture 10: Setting Backpropagation Parameters 1 Creating Data Representations On the other hand, sets of orthogonal vectors.
Artificial Neural Networks -Application- Peter Andras
Neural Networks. Background - Neural Networks can be : Biological - Biological models Artificial - Artificial models - Desire to produce artificial systems.
Radial Basis Function Networks
SE367 Project Final Presentation By: Sujith Thomas Parimi Krishna Chaitanya In charge:- Prof Amitabha Mukerjee.
Introduction to Artificial Intelligence Lecture 2: Perception & Action
CSSE463: Image Recognition Day 21 Upcoming schedule: Upcoming schedule: Exam covers material through SVMs Exam covers material through SVMs.
Machine Learning. Learning agent Any other agent.
Chapter 11: Artificial Intelligence
Data Flow Diagram A method used to analyze a system in a structured way Used during: Analysis stage: to describe the current system Design stage: to describe.
CSC 213 – Large Scale Programming Lecture 2: Object-Oriented Analysis & Object-Oriented Design.
Artificial Neural Networks (ANN). Output Y is 1 if at least two of the three inputs are equal to 1.
1 Artificial Neural Networks Sanun Srisuk EECP0720 Expert Systems – Artificial Neural Networks.
 The most intelligent device - “Human Brain”.  The machine that revolutionized the whole world – “computer”.  Inefficiencies of the computer has lead.
1 Pattern Recognition: Statistical and Neural Lonnie C. Ludeman Lecture 23 Nov 2, 2005 Nanjing University of Science & Technology.
Chapter 3 Neural Network Xiu-jun GONG (Ph. D) School of Computer Science and Technology, Tianjin University
11 CSE 4705 Artificial Intelligence Jinbo Bi Department of Computer Science & Engineering
CONTENTS:  Introduction  What is neural network?  Models of neural networks  Applications  Phases in the neural network  Perceptron  Model of fire.
For games. 1. Control  Controllers for robotic applications.  Robot’s sensory system provides inputs and output sends the responses to the robot’s motor.
Classification / Regression Neural Networks 2
Artificial Intelligence Techniques Multilayer Perceptrons.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11: Artificial Intelligence Computer Science: An Overview Tenth Edition.
CHAPTER 10: CORE MECHANICS Definitions and Mechanisms.
Machine Learning for an Artificial Intelligence Playing Tic-Tac-Toe Computer Systems Lab 2005 By Rachel Miller.
CSC Intro. to Computing Lecture 22: Artificial Intelligence.
I Robot.
More on Logic Today we look at the for loop and then put all of this together to look at some more complex forms of logic that a program will need The.
Neural Network Implementation of Poker AI
WEEK INTRODUCTION IT440 ARTIFICIAL INTELLIGENCE.
Back-Propagation Algorithm AN INTRODUCTION TO LEARNING INTERNAL REPRESENTATIONS BY ERROR PROPAGATION Presented by: Kunal Parmar UHID:
Neural Networks Presented by M. Abbasi Course lecturer: Dr.Tohidkhah.
Neural Networks Teacher: Elena Marchiori R4.47 Assistant: Kees Jong S2.22
Hazırlayan NEURAL NETWORKS Backpropagation Network PROF. DR. YUSUF OYSAL.
More on Logic Today we look at the for loop and then put all of this together to look at some more complex forms of logic that a program will need The.
Bab 5 Classification: Alternative Techniques Part 4 Artificial Neural Networks Based Classifer.
Flexible and fast convergent learning agent Miguel A. Soto Santibanez Michael M. Marefat Department of Electrical and Computer Engineering University of.
ConvNets for Image Classification
Neural networks (2) Reminder Avoiding overfitting Deep neural network Brief summary of supervised learning methods.
Understanding AI of 2 Player Games. Motivation Not much experience in AI (first AI project) and no specific interests/passion that I wanted to explore.
Chapter 11 – Neural Nets © Galit Shmueli and Peter Bruce 2010 Data Mining for Business Intelligence Shmueli, Patel & Bruce.
A PID Neural Network Controller
© 2009, Tom McKendree The Systems Engineering Game (Basic Game) 1.0 Introduction This is a game about the systems engineering process, as represented by.
General-Purpose Learning Machine
Chapter 11: Artificial Intelligence
Chapter 11: Artificial Intelligence
Learning in Neural Networks
Chapter 3. Artificial Neural Networks - Introduction -
Neuro-Computing Lecture 4 Radial Basis Function Network
CSSE463: Image Recognition Day 17
Neural Networks Geoff Hulten.
CSSE463: Image Recognition Day 17
FLIPPED CLASSROOM ACTIVITY CONSTRUCTOR – USING EXISTING CONTENT
CSC 578 Neural Networks and Deep Learning
Presentation transcript:

Playing Tic-Tac-Toe with Neural Networks Zachary McNellis CPSC 4820

What is a robot? Sense, think, act

Sense, Think, React Robotics technology consists of mechanisms that can: Sense – Feedback devices (sensors) allow information about the environment to be recorded Think – Information is processed in some way (simple or complex) Act – Most obvious part of a robot. However, it can be anything from outputting a value to making the robot walk Acting is the most obvious part of robotics technology. The electronic signals that were produced as a result of sensing and thinking then control whatever the robot is designed to do, like lift a sick person, make a facial expression, or control the motors that allow it to navigate around an obstacle.

Creating a tic-tac-toe engine Board representation What move to make? Win, Lose, Draw

Board Representation 3 0 2 1 1 1 1 1 1 1 1 1 9 board positions 4 7 2 5 8 3 6 9 3 0 2 1 1 1 1 1 1 1 1 1 9 board positions Player 1 Player 2 Empty 0 2 1 Dimension, player 1, player 2 Positions labeled 1-9

What Move to Make? What does a tic-tac-toe engine do? Input: board state 3 0 2 1 1 1 1 1 1 1 1 1 Ex. “3 0 2 1 1 1 1 1 1 1 1 1 | ./my_engine” Output: next move Avoid collisions Ex. “5”

Win, Lose, or Draw “playtictactoe.py” Output Specify number of games Engine 1 Engine 2 Output Game progression Player 1 win ___ times Draw ___ times Player 2 win ___ times

1. Random Engine Implementation details Results summary

Implementation Details Java Slow execution Internal representation of board state x---ox--o x: player 1 o: player 2 -: empty position 2 dimensional array Polymorphism to easily allow different engine implementations Player player = new RandomPlayer(board, turn);

Results Summary random_engine vs random_engine Player 1 win 49 Draw 13 times Player 2 win 38 About equal number of wins from player 1 as player 2

2. “Smart” Engine Implementation details Case based reasoning Results summary

Implementation Details Java Rules were simple and came from hands-on experience IF able to get 3 in a row, play winning position ELSE IF able to block opponent, play blocking position ELSE IF empty, play edge position ELSE play random position

Case Based Reasoning Use reverse logic to figure out “rules” governing an unknown engine Steps Retrieve Reuse Revise Retain

Results Summary random_engine vs smart_engine Player 1 win 8 Draw 29 times Player 2 win 63 smart_engine vs smart_engine Player 1 win 59 Draw 10 times Player 2 win 31

3. Neural Network Engine Neural network overview Implementation details Results summary

Neural Network Overview Provides ability to “learn” how to do tasks based on training data Requires linear and nonlinear step to produce a set of weights Weights map training input to training output Learning rate used to discover a set of weights that result in an error of 0, in which all inputs are precisely mapped to all outputs

Implementation Details Goal: train neural network on data produced by previous “smart engine” Input: state of the board Output: next move Neural network trainer Python Allows user to pass in parameters such as learning rate, bias, input, output, and weight files 15 pairs of inputs and outputs used Difficulty of convergence Neural network engine Use set of weights used by trainer to generate “next move”

Results Summary neural_engine vs smart_engine Player 1 win 38 Draw 11 times Player 2 win 51 neural_engine vs random_engine Player 1 win 56 Draw 12 times Player 2 win 32

4. PyBrain Engine PyBrain neural network library Implementation details Results summary

Implementation Details Goal: Implement same neural network engine using training weights produced from an external library PyBrain Python-Based Reinforcement Learning, Artificial Intelligence and Neural Network Library http://pybrain.org/ Used backpropogation method of training values Optimization of errors, minimizing loss function Allows higher chance of convergence for larger data sets 25 pairs of input/output compared to 15

Results Summary smart_engine vs neurallib_engine Player 1 win 51 Draw 6 times Player 2 win 43 random_engine vs neurallib_engine Player 1 win 30 Draw times 16 Player 2 win 54

(5?) Self Organizing Maps Another type of neural network Using weights in different ways Weights are now nodes instead of connections Useful for identifying what the inputs should be Weights are updated based on geography Useful for pattern completion Could be used in tic-tac-toe engine to determine whether a given board state is valid or not You may already be aware of supervised training techniques such as backpropagation where the training data consists of vector pairs - an input vector and a target vector. With this approach an input vector is presented to the network (typically a multilayer feedforward network) and the output is compared with the target vector. If they differ, the weights of the network are altered slightly to reduce the error in the output. This is repeated many times and with many sets of vector pairs until the network gives the desired output. Training a SOM however, requires no target vector. A SOM learns to classify the training data without any external supervision whatsoever.

Now I’ll show a demonstration of running the programs I’ve been discussing