Skip to content

Commit

Permalink
testing code
Browse files Browse the repository at this point in the history
  • Loading branch information
landoskape committed Apr 10, 2024
1 parent 1594f3a commit 1f3300e
Showing 1 changed file with 39 additions and 7 deletions.
46 changes: 39 additions & 7 deletions dominoes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"id": "d743f019-bcc5-4c13-8aef-98e737e0747e",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Using device: cpu\n"
"ename": "ImportError",
"evalue": "cannot import name 'transformers' from 'dominoes.networks' (/Users/landauland/Documents/GitHub/dominoes/dominoes/networks/__init__.py)",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[2], line 14\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mmatplotlib\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mpyplot\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mplt\u001b[39;00m\n\u001b[1;32m 13\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mmatplotlib\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mmpl\u001b[39;00m\n\u001b[0;32m---> 14\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdominoes\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m leagueManager \u001b[38;5;28;01mas\u001b[39;00m lm\n\u001b[1;32m 15\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdominoes\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m gameplay \u001b[38;5;28;01mas\u001b[39;00m dg\n\u001b[1;32m 16\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdominoes\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m agents \u001b[38;5;28;01mas\u001b[39;00m da\n",
"File \u001b[0;32m~/Documents/GitHub/dominoes/dominoes/__init__.py:1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01magents\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdominoeAgent\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m dominoeAgent\n",
"File \u001b[0;32m~/Documents/GitHub/dominoes/dominoes/agents/__init__.py:3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdominoeAgent\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m dominoeAgent\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mbasicAgents\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m greedyAgent, stupidAgent, doubleAgent, bestLineAgent, persistentLineAgent\n\u001b[0;32m----> 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mtdAgents\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m basicValueAgent, lineValueAgent, lineValueAgentSmall\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mtransformerAgents\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m transformerAgent\n",
"File \u001b[0;32m~/Documents/GitHub/dominoes/dominoes/agents/tdAgents.py:9\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mcopy\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m copy\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mtorch\u001b[39;00m\n\u001b[0;32m----> 9\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mnetworks\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m dominoe_networks \u001b[38;5;28;01mas\u001b[39;00m dnn\n\u001b[1;32m 12\u001b[0m \u001b[38;5;66;03m# ----------------------------------------------------------------------------\u001b[39;00m\n\u001b[1;32m 13\u001b[0m \u001b[38;5;66;03m# -------------------------- RL Agents that estimate value -------------------\u001b[39;00m\n\u001b[1;32m 14\u001b[0m \u001b[38;5;66;03m# ----------------------------------------------------------------------------\u001b[39;00m\n\u001b[1;32m 15\u001b[0m \u001b[38;5;28;01mclass\u001b[39;00m \u001b[38;5;21;01mvalueAgent\u001b[39;00m(dominoeAgent):\n\u001b[1;32m 16\u001b[0m \u001b[38;5;66;03m# valueAgent is a mid-level class for all agents that perform TD-Lambda like value computations.\u001b[39;00m\n",
"File \u001b[0;32m~/Documents/GitHub/dominoes/dominoes/networks/dominoe_networks.py:5\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mtorch\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mnn\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mfunctional\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mF\u001b[39;00m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mtorch\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m nn\n\u001b[0;32m----> 5\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m transformers \u001b[38;5;28;01mas\u001b[39;00m transformers\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mget_device\u001b[39m(tensor):\n\u001b[1;32m 9\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"simple method to get device of input tensor\"\"\"\u001b[39;00m\n",
"\u001b[0;31mImportError\u001b[0m: cannot import name 'transformers' from 'dominoes.networks' (/Users/landauland/Documents/GitHub/dominoes/dominoes/networks/__init__.py)"
]
}
],
Expand Down Expand Up @@ -53,10 +61,34 @@
"outputs": [],
"source": [
"# TODO For refactoring\n",
"# in datasets.support, I just moved trainTestDominoes, clean that, integrate it in DatasetInitialization, and anywhere else\n",
"# continue working on generate_batch method in DominoesDataset"
"# continue working on generate_batch method in DominoesDataset\n",
"# "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8404c54b",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "3cb14b32",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "94b81df6",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 9,
Expand Down

0 comments on commit 1f3300e

Please sign in to comment.