Skip to content

Commit

Permalink
updating example notebooks to 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
rory-nasa committed Apr 19, 2024
1 parent fe02e73 commit dab0c91
Show file tree
Hide file tree
Showing 9 changed files with 213 additions and 17,609 deletions.
6 changes: 1 addition & 5 deletions examples/cartpole/Project.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
[deps]
AdaStress = "f8632b6a-8763-4da0-bfaf-5f7707adef25"
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ReinforcementLearning = "158674fc-8238-5cab-b5ba-03dfc80d1318"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
ReinforcementLearningExperiments = "6bd458e5-1694-412f-b601-3a888375c491"
408 changes: 63 additions & 345 deletions examples/cartpole/cartpole.ipynb

Large diffs are not rendered by default.

Binary file removed examples/cartpole/dqn_policy.bson
Binary file not shown.
15,835 changes: 17 additions & 15,818 deletions examples/cas/cas.ipynb

Large diffs are not rendered by default.

307 changes: 24 additions & 283 deletions examples/fms/fms.ipynb

Large diffs are not rendered by default.

115 changes: 18 additions & 97 deletions examples/pedestrian/pedestrian-client.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,12 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "celtic-clerk",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[32m\u001b[1m Activating\u001b[22m\u001b[39m project at `C:\\Users\\rlipkis\\.julia\\dev\\adastress\\examples\\pedestrian`\n",
"\u001b[32m\u001b[1m Resolving\u001b[22m\u001b[39m package versions...\n",
"\u001b[32m\u001b[1m No Changes\u001b[22m\u001b[39m to `C:\\Users\\rlipkis\\.julia\\dev\\adastress\\examples\\pedestrian\\Project.toml`\n",
"\u001b[32m\u001b[1m No Changes\u001b[22m\u001b[39m to `C:\\Users\\rlipkis\\.julia\\dev\\adastress\\examples\\pedestrian\\Manifest.toml`\n"
]
}
],
"outputs": [],
"source": [
"using Pkg\n",
"Pkg.activate(\".\")\n",
Expand All @@ -44,7 +33,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "ongoing-regulation",
"metadata": {},
"outputs": [],
Expand All @@ -56,127 +45,59 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "metropolitan-charm",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"AdaStress.Interface.ASTClient(ip\"156.68.48.136\", 2000, nothing, false, false, false, Any[])"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"client = Interface.ASTClient(; ip=Interface.getipaddr(), port=2000)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "challenging-switch",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"┌ Info: ASTServer responded in 1666 milliseconds.\n",
"└ @ AdaStress.Interface C:\\Users\\rlipkis\\.julia\\dev\\adastress\\src\\interface\\remote\\client.jl:131\n"
]
}
],
"outputs": [],
"source": [
"Interface.connect!(client)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "forced-poker",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"MCTS(10000, 10, 1.0, 0.85, 1.0, nothing)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"mcts = MCTS(num_iterations=10_000, α=0.85)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "brutal-brooklyn",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[32mProgress: 100%|█████████████████████████████████████████| Time: 0:01:51\u001b[39m\n"
]
},
{
"data": {
"text/plain": [
"DataStructures.PriorityQueue{Any, Any, Base.Order.ForwardOrdering} with 10 entries:\n",
" MCTSResult(UInt32[0xe67d225b, 0x5f9be755, 0x0aed2eeb, 0x26840a96, … => 1087.52\n",
" MCTSResult(UInt32[0xef05d725, 0xde2fae7c, 0x2cf7afe5, 0x512ae58c, … => 1087.8\n",
" MCTSResult(UInt32[0xe67d225b, 0xaccaa267, 0x9944dbf8, 0x20727eff, … => 1087.81\n",
" MCTSResult(UInt32[0xe67d225b, 0x34e1b7a5, 0x27d8ee5b, 0x4d041c41, … => 1087.82\n",
" MCTSResult(UInt32[0xe67d225b, 0xd21aebe7, 0xd339f33c, 0x6847add5, … => 1087.86\n",
" MCTSResult(UInt32[0xe67d225b, 0x34e1b7a5, 0x900a8fe4, 0xc1741547, … => 1087.87\n",
" MCTSResult(UInt32[0xe67d225b, 0x34e1b7a5, 0xe3ebdc90, 0x0daa5991, … => 1088.13\n",
" MCTSResult(UInt32[0xe67d225b, 0x34e1b7a5, 0x900a8fe4, 0xab3981e6, … => 1088.23\n",
" MCTSResult(UInt32[0xe67d225b, 0x34e1b7a5, 0x900a8fe4, 0x3a475166, … => 1088.29\n",
" MCTSResult(UInt32[0xe67d225b, 0x17803b35, 0x78726223, 0x7ea848d4, … => 1088.46"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"Random.seed!(0)\n",
"sol = mcts(() -> Interface.generate_mdp(client))"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"id": "angry-speed",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"MonteCarloTreeSearch.total_size(mcts.tree) = 10000\n",
"MonteCarloTreeSearch.max_depth(mcts.tree) = 8\n"
]
}
],
"outputs": [],
"source": [
"@show MonteCarloTreeSearch.total_size(mcts.tree);\n",
"@show MonteCarloTreeSearch.max_depth(mcts.tree);"
]
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"id": "competitive-apollo",
"metadata": {},
"outputs": [],
Expand All @@ -186,7 +107,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"id": "gentle-strengthening",
"metadata": {},
"outputs": [],
Expand All @@ -205,15 +126,15 @@
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.7.0",
"display_name": "Julia 1.10.2",
"language": "julia",
"name": "julia-1.7"
"name": "julia-1.10"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.7.0"
"version": "1.10.2"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit dab0c91

Please sign in to comment.