Skip to content

Commit

Permalink
Merge pull request #155 from leondavi/data-split
Browse files Browse the repository at this point in the history
Data split
  • Loading branch information
leondavi authored Jan 10, 2023
2 parents c06cb86 + 4d92a72 commit 0c3c6fb
Show file tree
Hide file tree
Showing 60 changed files with 433 additions and 527 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ src_cpp/*.so
/src_cpp/opennnBridge/CMakeFiles
/src_cpp/opennnBridge/Makefile
/src_cpp/opennnBridge/\[binary_dir\]
src_erl/NerlGUI/_build/*
examples/.ipynb_checkpoints/simple_run-checkpoint.ipynb
119 changes: 111 additions & 8 deletions examples/simple_run.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,97 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "6ce55378",
"metadata": {},
"outputs": [],
"source": [
"from apiServer import *\n",
"from experiment import *"
"from experiment import *\n",
"api_server_instance = ApiServer()"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "e7d7d7d4",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Architechure Files\n",
"--------------------\n",
"\n",
"0.\tarch_1PC1Worker.json\n",
"1.\tarch_1PC1Worker_autoencoder.json\n",
"2.\tarch_1PC2Worker2RouterMonitored.json\n",
"3.\tarch_1PC2WorkerMonitored.json\n",
"4.\tarch_1PC2Workers2Sources_autoencoder.json\n",
"5.\tarch_2PC2Workers.json\n",
"6.\tarch_3Devs3Workers1SourceH.json\n",
"7.\tarch_3Devs4Workers1SourceGUI.json\n",
"8.\tarch_3PC2Workers1SourceMonitored.json\n",
"9.\tarch_4Devs4Workers1Source.json\n",
"10.\tarch_4Devs4Workers1Source1fed.json\n",
"11.\tarch_4Devs4Workers1SourceMonitored.json\n",
"12.\tarch_4Devs4Workers1Source_autoencoder.json\n",
"13.\tarch_4Devs4Workers2Sources.json\n",
"14.\tarch_4Devs4Workers2Sources1fed.json\n",
"15.\tarch_4Devs4Workers2SourcesAzure.json\n",
"16.\tarch_PC1WorkerMonitored.json\n",
"\n",
"Connection Map Files\n",
"--------------------\n",
"\n",
"0.\tconn_1PC1Worker.json\n",
"1.\tconn_1Router2Clients.json\n",
"2.\tconn_1Router3Clients.json\n",
"3.\tconn_1Router4Clients.json\n",
"4.\tconn_1Router4Clients1fed.json\n",
"5.\tconn_1Router4Clients2Sources.json\n",
"6.\tconn_1Router4Clients2Sources1fed.json\n",
"7.\tconn_2Router2Clients1Source.json\n",
"8.\tconn_2Router2ClientsGUI.json\n",
"9.\tconn_3Router3Clients.json\n",
"\n",
"Experiments Flow Files\n",
"--------------------\n",
"\n",
"0.\texp_1Worker1Source.json\n",
"1.\texp_1Worker1SourceAE.json\n",
"2.\texp_2Devs2Workers.json\n",
"3.\texp_2Worke3Router1Source.json\n",
"4.\texp_2Worker1Source.json\n",
"5.\texp_2Worker2Router1Source.json\n",
"6.\texp_2Workers2SourcesAE.json\n",
"7.\texp_3Workers1Source.json\n",
"8.\texp_4Workers1Source1fed.json\n",
"9.\texp_4Workers1SourceGauss.json\n",
"10.\texp_4Workers1SourceNum.json\n",
"11.\texp_4Workers2Sources.json\n",
"12.\texp_4Workers2Sources1fed.json\n"
]
},
{
"ename": "KeyboardInterrupt",
"evalue": "Interrupted by user",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn [2], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m api_server_instance\u001b[38;5;241m.\u001b[39mshowJsons()\n\u001b[0;32m----> 2\u001b[0m \u001b[43mapi_server_instance\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mselectJsons\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4\u001b[0m arch_json , connmap_json, exp_flow_json \u001b[38;5;241m=\u001b[39m api_server_instance\u001b[38;5;241m.\u001b[39mgetUserJsons()\n",
"File \u001b[0;32m~/workspace/NErlNet/JupyterLabDir/apiServer.py:90\u001b[0m, in \u001b[0;36mApiServer.selectJsons\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 89\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mselectJsons\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m---> 90\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mjson_dir_parser\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mselect_arch_connmap_experiment\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/workspace/NErlNet/JupyterLabDir/jsonDirParser.py:88\u001b[0m, in \u001b[0;36mselect_arch_connmap_experiment\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 86\u001b[0m arch \u001b[38;5;241m=\u001b[39m \u001b[38;5;28minput\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124menter arch file #\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 87\u001b[0m connection_map \u001b[38;5;241m=\u001b[39m \u001b[38;5;28minput\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124menter conn_map file #\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m---> 88\u001b[0m experiment \u001b[38;5;241m=\u001b[39m \u001b[38;5;28minput\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124menter exp file #\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 89\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39muser_selection_tuple \u001b[38;5;241m=\u001b[39m (\u001b[38;5;28mint\u001b[39m(arch), \u001b[38;5;28mint\u001b[39m(connection_map), \u001b[38;5;28mint\u001b[39m(experiment))\n",
"File \u001b[0;32m~/workspace/venv-nerl/lib/python3.8/site-packages/ipykernel/kernelbase.py:1177\u001b[0m, in \u001b[0;36mKernel.raw_input\u001b[0;34m(self, prompt)\u001b[0m\n\u001b[1;32m 1173\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_allow_stdin:\n\u001b[1;32m 1174\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m StdinNotImplementedError(\n\u001b[1;32m 1175\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mraw_input was called, but this frontend does not support input requests.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1176\u001b[0m )\n\u001b[0;32m-> 1177\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_input_request\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1178\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mstr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mprompt\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1179\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_parent_ident\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mshell\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1180\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_parent\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mshell\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpassword\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 1182\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/workspace/venv-nerl/lib/python3.8/site-packages/ipykernel/kernelbase.py:1219\u001b[0m, in \u001b[0;36mKernel._input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 1216\u001b[0m \u001b[38;5;28;01mbreak\u001b[39;00m\n\u001b[1;32m 1217\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyboardInterrupt\u001b[39;00m:\n\u001b[1;32m 1218\u001b[0m \u001b[38;5;66;03m# re-raise KeyboardInterrupt, to truncate traceback\u001b[39;00m\n\u001b[0;32m-> 1219\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mKeyboardInterrupt\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mInterrupted by user\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28mNone\u001b[39m\n\u001b[1;32m 1220\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m:\n\u001b[1;32m 1221\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlog\u001b[38;5;241m.\u001b[39mwarning(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mInvalid Message:\u001b[39m\u001b[38;5;124m\"\u001b[39m, exc_info\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: Interrupted by user"
]
}
],
"source": [
"api_server_instance = ApiServer()\n",
"\n",
"api_server_instance.showJsons()\n",
"api_server_instance.selectJsons()\n",
"\n",
Expand Down Expand Up @@ -50,7 +123,9 @@
"cell_type": "code",
"execution_count": null,
"id": "639a9b13",
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"api_server_instance.train()"
Expand All @@ -60,7 +135,9 @@
"cell_type": "code",
"execution_count": null,
"id": "ff716693",
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"api_server_instance.predict()"
Expand All @@ -85,6 +162,32 @@
"source": [
"api_server_instance.statistics()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2b88c1fc",
"metadata": {},
"outputs": [],
"source": [
"api_server_instance.statistics()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f30d27c5",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "720f2b84",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
114 changes: 0 additions & 114 deletions inputJsonFiles/Architecture/2pc2workers.json

This file was deleted.

83 changes: 0 additions & 83 deletions inputJsonFiles/Architecture/arch_1PC1Worker.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
],
"devices": [
{
"host": "127.0.0.1",
"host": "192.168.0.108",
"entities": "mainServer,c1,s1,r1,nerlGUI"
}
],
"serverAPI": [
{
"host": "127.0.0.1",
"host": "192.168.0.108",
"port": "8095",
"args": ""
}
],
"nerlGUI": [
{
"host": "127.0.0.1",
"host": "192.168.0.108",
"port": "8096",
"args": ""
}
],
"mainServer": [
{
"host": "127.0.0.1",
"host": "192.168.0.108",
"port": "8080",
"args": ""
}
Expand Down
Loading

0 comments on commit 0c3c6fb

Please sign in to comment.