Skip to content
Permalink
Browse files

Cleaned up the repo

  • Loading branch information...
siemanko committed Nov 14, 2015
1 parent 2f97b5b commit b18632910339f788e61eb1e950ff72d132c7cab9
Showing with 22,397 additions and 619 deletions.
  1. +296 −0 notebooks/Goofiness.ipynb
  2. 0 { → notebooks}/MLP.ipynb
  3. 0 { → notebooks}/XOR Network.ipynb
  4. +365 −618 demo.ipynb → notebooks/karpathy_game.ipynb
  5. +164 −0 notebooks/my_sim/0.svg
  6. +164 −0 notebooks/my_sim/1.svg
  7. +164 −0 notebooks/my_sim/10.svg
  8. +164 −0 notebooks/my_sim/100.svg
  9. +164 −0 notebooks/my_sim/101.svg
  10. +164 −0 notebooks/my_sim/102.svg
  11. +164 −0 notebooks/my_sim/103.svg
  12. +164 −0 notebooks/my_sim/104.svg
  13. +164 −0 notebooks/my_sim/105.svg
  14. +164 −0 notebooks/my_sim/106.svg
  15. +164 −0 notebooks/my_sim/107.svg
  16. +164 −0 notebooks/my_sim/108.svg
  17. +164 −0 notebooks/my_sim/109.svg
  18. +164 −0 notebooks/my_sim/11.svg
  19. +164 −0 notebooks/my_sim/110.svg
  20. +164 −0 notebooks/my_sim/111.svg
  21. +164 −0 notebooks/my_sim/112.svg
  22. +164 −0 notebooks/my_sim/113.svg
  23. +164 −0 notebooks/my_sim/114.svg
  24. +164 −0 notebooks/my_sim/115.svg
  25. +164 −0 notebooks/my_sim/116.svg
  26. +164 −0 notebooks/my_sim/117.svg
  27. +164 −0 notebooks/my_sim/118.svg
  28. +164 −0 notebooks/my_sim/119.svg
  29. +164 −0 notebooks/my_sim/12.svg
  30. +164 −0 notebooks/my_sim/120.svg
  31. +164 −0 notebooks/my_sim/121.svg
  32. +164 −0 notebooks/my_sim/122.svg
  33. +164 −0 notebooks/my_sim/123.svg
  34. +164 −0 notebooks/my_sim/124.svg
  35. +164 −0 notebooks/my_sim/125.svg
  36. +164 −0 notebooks/my_sim/126.svg
  37. +164 −0 notebooks/my_sim/127.svg
  38. +164 −0 notebooks/my_sim/128.svg
  39. +164 −0 notebooks/my_sim/13.svg
  40. +164 −0 notebooks/my_sim/14.svg
  41. +164 −0 notebooks/my_sim/15.svg
  42. +164 −0 notebooks/my_sim/16.svg
  43. +164 −0 notebooks/my_sim/17.svg
  44. +164 −0 notebooks/my_sim/18.svg
  45. +164 −0 notebooks/my_sim/19.svg
  46. +164 −0 notebooks/my_sim/2.svg
  47. +164 −0 notebooks/my_sim/20.svg
  48. +164 −0 notebooks/my_sim/21.svg
  49. +164 −0 notebooks/my_sim/22.svg
  50. +164 −0 notebooks/my_sim/23.svg
  51. +164 −0 notebooks/my_sim/24.svg
  52. +164 −0 notebooks/my_sim/25.svg
  53. +164 −0 notebooks/my_sim/26.svg
  54. +164 −0 notebooks/my_sim/27.svg
  55. +164 −0 notebooks/my_sim/28.svg
  56. +164 −0 notebooks/my_sim/29.svg
  57. +164 −0 notebooks/my_sim/3.svg
  58. +164 −0 notebooks/my_sim/30.svg
  59. +164 −0 notebooks/my_sim/31.svg
  60. +164 −0 notebooks/my_sim/32.svg
  61. +164 −0 notebooks/my_sim/33.svg
  62. +164 −0 notebooks/my_sim/34.svg
  63. +164 −0 notebooks/my_sim/35.svg
  64. +164 −0 notebooks/my_sim/36.svg
  65. +164 −0 notebooks/my_sim/37.svg
  66. +164 −0 notebooks/my_sim/38.svg
  67. +164 −0 notebooks/my_sim/39.svg
  68. +164 −0 notebooks/my_sim/4.svg
  69. +164 −0 notebooks/my_sim/40.svg
  70. +164 −0 notebooks/my_sim/41.svg
  71. +164 −0 notebooks/my_sim/42.svg
  72. +164 −0 notebooks/my_sim/43.svg
  73. +164 −0 notebooks/my_sim/44.svg
  74. +164 −0 notebooks/my_sim/45.svg
  75. +164 −0 notebooks/my_sim/46.svg
  76. +164 −0 notebooks/my_sim/47.svg
  77. +164 −0 notebooks/my_sim/48.svg
  78. +164 −0 notebooks/my_sim/49.svg
  79. +164 −0 notebooks/my_sim/5.svg
  80. +164 −0 notebooks/my_sim/50.svg
  81. +164 −0 notebooks/my_sim/51.svg
  82. +164 −0 notebooks/my_sim/52.svg
  83. +164 −0 notebooks/my_sim/53.svg
  84. +164 −0 notebooks/my_sim/54.svg
  85. +164 −0 notebooks/my_sim/55.svg
  86. +164 −0 notebooks/my_sim/56.svg
  87. +164 −0 notebooks/my_sim/57.svg
  88. +164 −0 notebooks/my_sim/58.svg
  89. +164 −0 notebooks/my_sim/59.svg
  90. +164 −0 notebooks/my_sim/6.svg
  91. +164 −0 notebooks/my_sim/60.svg
  92. +164 −0 notebooks/my_sim/61.svg
  93. +164 −0 notebooks/my_sim/62.svg
  94. +164 −0 notebooks/my_sim/63.svg
  95. +164 −0 notebooks/my_sim/64.svg
  96. +164 −0 notebooks/my_sim/65.svg
  97. +164 −0 notebooks/my_sim/66.svg
  98. +164 −0 notebooks/my_sim/67.svg
  99. +164 −0 notebooks/my_sim/68.svg
  100. +164 −0 notebooks/my_sim/69.svg
  101. +164 −0 notebooks/my_sim/7.svg
  102. +164 −0 notebooks/my_sim/70.svg
  103. +164 −0 notebooks/my_sim/71.svg
  104. +164 −0 notebooks/my_sim/72.svg
  105. +164 −0 notebooks/my_sim/73.svg
  106. +164 −0 notebooks/my_sim/74.svg
  107. +164 −0 notebooks/my_sim/75.svg
  108. +164 −0 notebooks/my_sim/76.svg
  109. +164 −0 notebooks/my_sim/77.svg
  110. +164 −0 notebooks/my_sim/78.svg
  111. +164 −0 notebooks/my_sim/79.svg
  112. +164 −0 notebooks/my_sim/8.svg
  113. +164 −0 notebooks/my_sim/80.svg
  114. +164 −0 notebooks/my_sim/81.svg
  115. +164 −0 notebooks/my_sim/82.svg
  116. +164 −0 notebooks/my_sim/83.svg
  117. +164 −0 notebooks/my_sim/84.svg
  118. +164 −0 notebooks/my_sim/85.svg
  119. +164 −0 notebooks/my_sim/86.svg
  120. +164 −0 notebooks/my_sim/87.svg
  121. +164 −0 notebooks/my_sim/88.svg
  122. +164 −0 notebooks/my_sim/89.svg
  123. +164 −0 notebooks/my_sim/9.svg
  124. +164 −0 notebooks/my_sim/90.svg
  125. +164 −0 notebooks/my_sim/91.svg
  126. +164 −0 notebooks/my_sim/92.svg
  127. +164 −0 notebooks/my_sim/93.svg
  128. +164 −0 notebooks/my_sim/94.svg
  129. +164 −0 notebooks/my_sim/95.svg
  130. +164 −0 notebooks/my_sim/96.svg
  131. +164 −0 notebooks/my_sim/97.svg
  132. +164 −0 notebooks/my_sim/98.svg
  133. +164 −0 notebooks/my_sim/99.svg
  134. +1 −0 notebooks/tf_rl
  135. 0 { → scripts}/make_gif.sh
  136. +1 −0 tf_rl/__init__.py
  137. +2 −0 tf_rl/controller/__init__.py
  138. +190 −0 tf_rl/controller/discrete_deepq.py
  139. +1 −1 human_control.py → tf_rl/controller/human_controller.py
  140. 0 tf_models.py → tf_rl/models.py
  141. +102 −0 tf_rl/simulate.py
  142. +1 −0 tf_rl/simulation/__init__.py
  143. +282 −0 tf_rl/simulation/karpathy_game.py
  144. 0 tf_rl/utils/__init__.py
  145. 0 { → tf_rl/utils}/event_queue.py
  146. 0 { → tf_rl/utils}/geometry.py
  147. 0 { → tf_rl/utils}/getch.py
  148. 0 { → tf_rl/utils}/svg.py
@@ -0,0 +1,296 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import tensorflow as tf\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"t = tf.random_normal((4,3))"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Exception AssertionError: AssertionError() in <bound method InteractiveSession.__del__ of <tensorflow.python.client.session.InteractiveSession object at 0x7f8d1448e150>> ignored\n"
]
}
],
"source": [
"sess = tf.InteractiveSession()"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[array([[ 0.72746545, -0.68051934, 0.21055566],\n",
" [ 0.85468984, -1.73917162, -1.21599209],\n",
" [ 0.58213192, -0.90190017, -0.64913821],\n",
" [-0.86752349, 0.16742691, 0.84491307]], dtype=float32),\n",
" array([0, 0, 0, 2])]"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run([t, tf.arg_max(t, dimension=1)])"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"?tf.arg_max"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"c = tf.constant(0.5)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[array([[ 0.34724277, 0.6608656 , 0.43116933],\n",
" [-0.48315111, 0.892003 , 0.60531151],\n",
" [ 0.17994949, 0.13526289, -0.71118593],\n",
" [ 0.2168636 , -0.0341404 , -1.04781568]], dtype=float32),\n",
" array([[ 0.17362139, 0.3304328 , 0.21558467],\n",
" [-0.24157555, 0.4460015 , 0.30265576],\n",
" [ 0.08997475, 0.06763145, -0.35559297],\n",
" [ 0.1084318 , -0.0170702 , -0.52390784]], dtype=float32)]"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run([t, c*t])"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[array([[ 0.46160161, -2.05513716, -2.90273142],\n",
" [-1.03117085, -0.45882538, -0.44779259],\n",
" [-0.61726028, -0.33546519, 0.38373214],\n",
" [ 0.83618456, -0.21057898, 2.06498384]], dtype=float32),\n",
" array([-4.49626684, -1.93778872, -0.56899333, 2.69058943], dtype=float32)]"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run([t, tf.reduce_sum(t, reduction_indices=[1,])])"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"i = tf.placeholder(tf.int32, (4,))"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {
"collapsed": false
},
"outputs": [
{
"ename": "TypeError",
"evalue": "Bad slice index Tensor(\"Placeholder_1:0\", shape=TensorShape([Dimension(4)]), dtype=int32) of type <class 'tensorflow.python.framework.ops.Tensor'>",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-36-39534c948248>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0msess\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mt\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m{\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0marray\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;32m/usr/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.pyc\u001b[0m in \u001b[0;36m_SliceHelper\u001b[1;34m(tensor, slice_spec)\u001b[0m\n\u001b[0;32m 127\u001b[0m \u001b[1;32mraise\u001b[0m \u001b[0mNotImplementedError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Ellipsis is not currently supported\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 128\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 129\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Bad slice index %s of type %s\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 130\u001b[0m \u001b[0msliced\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mslice\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtensor\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mindices\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0msizes\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 131\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0msqueeze_dims\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mTypeError\u001b[0m: Bad slice index Tensor(\"Placeholder_1:0\", shape=TensorShape([Dimension(4)]), dtype=int32) of type <class 'tensorflow.python.framework.ops.Tensor'>"
]
}
],
"source": [
"sess.run(t[i], {i: np.array([0,1,1,1])})"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[array([[ 0.02137903, 1.23828769, 0.53914273],\n",
" [-1.06534982, -0.21909024, -1.19062781],\n",
" [-0.50089341, -1.03411007, 0.02972561],\n",
" [ 1.17602372, 0.27990618, -1.23782802]], dtype=float32),\n",
" array([ 1.23828769, -0.21909024, 0.02972561, 1.17602372], dtype=float32)]"
]
},
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run([t, tf.reduce_max(t, 1)])"
]
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"?tf.train.RMSPropOptimizer"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {
"collapsed": false
},
"outputs": [
{
"ename": "ValueError",
"evalue": "too many values to unpack",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-46-4c110fc8efb5>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mb\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mc\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m3\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m4\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m5\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;31mValueError\u001b[0m: too many values to unpack"
]
}
],
"source": [
"a,b,c = [1,2,3,4,5]"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"x = tf.train.SummaryWriter(\"logs/\", sess.graph_def)"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"?x.add_summary"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"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.8"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
File renamed without changes.
File renamed without changes.

0 comments on commit b186329

Please sign in to comment.
You can’t perform that action at this time.