Aimbot-PPO/Aimbot-PPO-Python/Tensorflow/env.ipynb
Koha9 742529ccd7 Archive all tensorflow agents and env
archive all TF py&ipynb
turn face to pytorch.
2022-10-26 03:15:37 +09:00

161 lines
3.1 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import env"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"31\n",
"5\n",
"3\n"
]
}
],
"source": [
"a=1"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"包含None\n",
"[123 None]\n"
]
}
],
"source": [
"import numpy as np\n",
"\n",
"def qa(aa = None):\n",
" try:\n",
" isaanone = aa.any() == None\n",
" if aa.all() == None:\n",
" print(\"包含None\")\n",
" except:\n",
" isaanone =True\n",
" if isaanone:\n",
" print('none')\n",
" else:\n",
" print(aa)\n",
"\n",
"qa(np.array([123,None]))"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[[1 1 1 1 1]\n",
" [1 2 1 1 1]]\n",
"\n",
" [[2 1 3 4 5]\n",
" [2 2 3 4 5]]\n",
"\n",
" [[3 1 3 4 5]\n",
" [3 2 3 4 5]]]\n",
"-\n",
"tf.Tensor(\n",
"[[1 1 1 1 1]\n",
" [2 1 3 4 5]\n",
" [3 1 3 4 5]], shape=(3, 5), dtype=int32)\n",
"-\n",
"tf.Tensor(\n",
"[[1 2 1 1 1]\n",
" [2 2 3 4 5]\n",
" [3 2 3 4 5]], shape=(3, 5), dtype=int32)\n"
]
}
],
"source": [
"import numpy as np\n",
"import tensorflow as tf\n",
"\n",
"aa = np.array([[[1,1,1,1,1],[1,2,1,1,1],[1,3,1,1,1]],\n",
" [[2,1,3,4,5],[2,2,3,4,5],[2,3,3,4,5]],\n",
" [[3,1,3,4,5],[3,2,3,4,5],[3,3,3,4,5]]])\n",
"tt = tf.constant(aa)\n",
"bb = np.array([6,3,6,3,2,3])\n",
"\n",
"print(aa[:,0:2])\n",
"aa[:,2:]\n",
"\n",
"for asd in tf.transpose(aa[:,0:2],perm=[1,0,2]):\n",
" print('-')\n",
" print(asd)"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<tf.Tensor: shape=(), dtype=int32, numpy=1>"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import tensorflow as tf\n",
"aa = tf.constant(0)\n",
"bb = aa+1\n",
"bb\n"
]
}
],
"metadata": {
"interpreter": {
"hash": "86e2db13b09bd6be22cb599ea60c1572b9ef36ebeaa27a4c8e961d6df315ac32"
},
"kernelspec": {
"display_name": "Python 3.9.7 64-bit",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}