资源简介
压缩包中包括Reinforcement Learning An Introduction英文与中文文档,还包括涉及的课程代码。
代码片段和文件信息
#######################################################################
# Copyright (C) #
# 2016 - 2018 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# 2016 Jan Hakenberg(jan.hakenberg@gmail.com) #
# 2016 Tian Jun(tianjun.cpp@gmail.com) #
# 2016 Kenta Shimada(hyperkentakun@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
#######################################################################
import numpy as np
import pickle
BOARD_ROWS = 3
BOARD_COLS = 3
BOARD_SIZE = BOARD_ROWS * BOARD_COLS
class State:
def __init__(self):
# the board is represented by an n * n array
# 1 represents a chessman of the player who moves first
# -1 represents a chessman of another player
# 0 represents an empty position
self.data = np.zeros((BOARD_ROWS BOARD_COLS))
self.winner = None
self.hash_val = None
self.end = None
# compute the hash value for one state it‘s unique
def hash(self):
if self.hash_val is None:
self.hash_val = 0
for i in self.data.reshape(BOARD_ROWS * BOARD_COLS):
if i == -1:
i = 2
self.hash_val = self.hash_val * 3 + i
return int(self.hash_val)
# check whether a player has won the game or it‘s a tie
def is_end(self):
if self.end is not None:
return self.end
results = []
# check row
for i in range(0 BOARD_ROWS):
results.append(np.sum(self.data[i :]))
# check columns
for i in range(0 BOARD_COLS):
results.append(np.sum(self.data[: i]))
# check diagonals
results.append(0)
for i in range(0 BOARD_ROWS):
results[-1] += self.data[i i]
results.append(0)
for i in range(0 BOARD_ROWS):
results[-1] += self.data[i BOARD_ROWS - 1 - i]
for result in results:
if result == 3:
self.winner = 1
self.end = True
return self.end
if result == -3:
self.winner = -1
self.end = True
return self.end
# whether it‘s a tie
sum = np.sum(np.abs(self.data))
if sum == BOARD_ROWS * BOARD_COLS:
self.winner = 0
self.end = True
return self.end
# game is still going on
self.end = False
return self.end
# @symbol: 1 or -1
# put chessman symbol in position (i j)
def next_state(self i j symbol):
new_state = State()
new_state.data = np.copy(self.data)
new_state.data[i j] = symbol
return new_state
# print the board
def print(self):
for i
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 12613382 2018-09-29 12:23 Reinforcement Learning-增强学习(文档+代码)\Reinforcement Learning:An Introduction.pdf
文件 40 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\.gitignore
文件 148 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\.travis.yml
文件 11177 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter01\tic_tac_toe.py
文件 9048 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter02\ten_armed_testbed.py
文件 3808 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter03\grid_world.py
文件 7391 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter04\car_rental.py
文件 2445 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter04\gamblers_problem.py
文件 3436 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter04\grid_world.py
文件 13065 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter05\blackjack.py
文件 1814 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter05\infinite_variance.py
文件 9355 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter06\cliff_walking.py
文件 4269 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter06\maximization_bias.py
文件 6574 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter06\random_walk.py
文件 4018 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter06\windy_grid_world.py
文件 4249 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter07\random_walk.py
文件 1627 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter08\expectation_vs_sample.py
文件 23252 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter08\maze.py
文件 4892 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter08\trajectory_sampling.py
文件 15793 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter09\random_walk.py
文件 4262 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter09\square_wave.py
文件 9605 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter10\access_control.py
文件 13681 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter10\mountain_car.py
文件 11839 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter11\counterexample.py
文件 12140 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter12\mountain_car.py
文件 9679 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter12\random_walk.py
文件 8012 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\chapter13\short_corridor.py
文件 36003 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\images\example_13_1.png
文件 238133 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\images\example_6_2.png
文件 31488 2018-09-17 16:16 Reinforcement Learning-增强学习(文档+代码)\reinforcement-learning-an-introduction-master\images\example_8_4.png
............此处省略69个文件信息
相关资源
- 深度学习图像库
- 人工智能一种现代的方法第三版英文
- 支持向量机:理论、算法与拓展
- Digital Image Processing 4th Edition.pdf.zip
- 统计学最经典教材(英文版)
- 深度学习Goodfellow Yoshua Bengio Aaron Cou
- 东北大学人工智能与机器学习课程课
- 人工智能-人脸识别源代码分享
- Unity开发人工智能坦克大战项目源码
- TensorFlow 1.x Deep Learning Cookbook 原版电子
- 哈尔滨工业大学-人工智能课件part1
- 动手学深度学习2019-05-21.rar
- 人工智能导论+人工智能基础扫描电子
- 华工2017年人工智能备考资料
- 李宏毅——深度学习ppt
- Keras中文文档.pdf
- MNIST 手写0-9数字图片识别
- 机器翻译例程tensorflow
- 《人工智能产品经理AI:时代PM修炼手
- 全球人工智能发展报告2018
- Pascal VOC 2007数据集用于物体检测
- DCGAN人脸生成项目
- 《分布式机器学习:算法、理论与实
- 深度学习入门的几篇经典论文原版英
- 多智能体机器学习 强化学习方法
- 不确定性人工智能
- yolov3-tiny.conv.15
- halcon 19 深度学习 和平版
- Machine Learning - A Probabilistic Perspective
- 西交大王永庆《人工智能原理与方法
评论
共有 条评论