Skip to content

Commit

Permalink
Merge branch 'main' into update_cross_site_eval
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterxgchen authored Aug 30, 2024
2 parents 6c1e6ad + 4be97a5 commit 8c4fa33
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
6 changes: 2 additions & 4 deletions examples/hello-world/step-by-step/cifar10/cse/cse.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,9 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "67c617df",
"cell_type": "markdown",
"id": "2f73c909",
"metadata": {},
"outputs": [],
"source": [
"Let's use the Job API to create a job and run using the simulator:"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,34 @@
"First add the `CyclicServerConfig` for the `CyclicServerController` with our desired parameters.\n",
"Here we set the required number of rounds, and also increase the max status report interval to 300 seconds.\n",
"\n",
"Next we add the `CyclicClientConfig` for the `CyclicClientController` that handles all `cyclic_*` tasks and maps the `learn_task_name` to the `train` task handled by the `ScriptRunner` with our `train.py` script. The `PTFileModelPersistor` with the initial `Net()` model and the `FullModelShareableGenerator` are also added as components in the `CyclicClientConfig`.\n",
"\n",
"Below is the Job API script:"
"Next we add the `CyclicClientConfig` for the `CyclicClientController` that handles all `cyclic_*` tasks and maps the `learn_task_name` to the `train` task handled by the `ScriptRunner` with our `train.py` script. The `PTFileModelPersistor` with the initial `Net()` model and the `FullModelShareableGenerator` are also added as components in the `CyclicClientConfig`."
]
},
{
"cell_type": "markdown",
"id": "bd739da0",
"metadata": {},
"source": [
"Let's first copy the required files:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1790c96c",
"metadata": {},
"outputs": [],
"source": [
"! cp ../code/fl/train.py train.py\n",
"! cp ../code/fl/net.py net.py"
]
},
{
"cell_type": "markdown",
"id": "c3def3f4",
"metadata": {},
"source": [
"Then we can use Job API to easily create a job and run in simulator:"
]
},
{
Expand All @@ -73,11 +98,6 @@
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"\n",
"code_path = \"../code/fl\"\n",
"if code_path not in sys.path:\n",
" sys.path.append(code_path)\n",
"\n",
"from net import Net\n",
"\n",
Expand All @@ -88,7 +108,7 @@
"\n",
"n_clients = 2\n",
"num_rounds = 3\n",
"train_script = \"../code/fl/train.py\"\n",
"train_script = \"train.py\"\n",
"\n",
"job = CCWFJob(name=\"cifar10_cyclic\")\n",
"\n",
Expand Down

0 comments on commit 8c4fa33

Please sign in to comment.