Added a first network
This commit is contained in:
parent
fc65735bca
commit
7cc8b6c025
@ -1,4 +1,8 @@
|
||||
# reversi
|
||||
|
||||
A Deep Learning implementation of the game Reversi aka. Otello.
|
||||
This is a Jupyter implementation only because it was requested in such a format for a class in my master’s degree. Enjoy the read or ignore it.
|
||||
This is a Jupyter implementation only because it was requested in such a format for a class in my master’s degree. Enjoy the read or ignore it.
|
||||
|
||||
## Comments from Gawron
|
||||
|
||||
- Use Zobrist hashing for symetry
|
||||
|
405
main.ipynb
405
main.ipynb
File diff suppressed because one or more lines are too long
172
test_main.ipynb
172
test_main.ipynb
@ -1,172 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": "array([[0., 0., 0., 0., 0.],\n [0., 0., 0., 0., 0.],\n [0., 0., 0., 0., 0.],\n [0., 0., 0., 0., 0.],\n [0., 0., 0., 0., 0.]])"
|
||||
},
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"a = np.zeros((5,5))\n",
|
||||
"a"
|
||||
],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": "array([[ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 10., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.]])"
|
||||
},
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"a[2,2] = 10\n",
|
||||
"a"
|
||||
],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"index_array = np.array([2,2], dtype=int)"
|
||||
],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"234 ns ± 7.47 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n",
|
||||
"311 ns ± 2.15 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"%timeit a[tuple(index_array.tolist())]\n",
|
||||
"%timeit a[index_array[0], index_array[1]]"
|
||||
],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def array_change(array):\n",
|
||||
" array[1] = 1"
|
||||
],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": "array([[ 0., 0., 0., 0., 0.],\n [ 1., 1., 1., 1., 1.],\n [ 0., 1., 10., 0., 0.],\n [ 1., 1., 1., 1., 1.],\n [ 0., 0., 0., 0., 0.]])"
|
||||
},
|
||||
"execution_count": 12,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"array_change(a[2:])\n",
|
||||
"a"
|
||||
],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": "array([[ 0., 0., 0., 0., 0.],\n [ 1., 1., 1., 1., 1.],\n [ 0., 1., 10., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.]])"
|
||||
},
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"a"
|
||||
],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"outputs": [],
|
||||
"source": [],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 2
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython2",
|
||||
"version": "2.7.6"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user