Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #FlipPredictor | |
| #A coin is drawn at random from a bag of coins of varying probabilities | |
| #Each coin has the same chance of being drawn | |
| #Your class FlipPredictor will be initialized with a list of the probability of | |
| #heads for each coin. This list of probabilities can be accessed as self.coins | |
| #in the functions you must write. The function update will be called after every | |
| #flip to enable you to update your estimate of the probability of each coin being | |
| #the selected coin. The function pheads may be called and any time and will | |
| #return your best estimate of the next flip landing on heads. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """A simple Markov Decision Process describing a painting robot. | |
| This problem is inspired by the "Planning" lesson from the CS 7637 (Knowledge- | |
| Based Artificial Intelligence) course at Georgia Institue of Technology, with | |
| Prof. Ashok Goyel. It was created in support of an MDP assignment in CS 7641 | |
| (Machine Learning), with Profs. Charles Isbell and Michael Littman. | |
| A robot is tasked with painting a ladder and a ceiling. The following | |
| independent states are possible, for a total of 8: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import numpy as np | |
| from pybrain.datasets import ClassificationDataSet | |
| from pybrain.structure.modules import SigmoidLayer, SoftmaxLayer | |
| from pybrain.supervised.trainers import BackpropTrainer | |
| from pybrain.tools.shortcuts import buildNetwork | |
| from pybrain.utilities import percentError | |