Skip to content

Commit

Permalink
add complete tutorial notebooks since their execution is deactivated …
Browse files Browse the repository at this point in the history
…on the docs server
  • Loading branch information
biphasic committed Aug 25, 2022
1 parent d5aac8e commit 27506c9
Show file tree
Hide file tree
Showing 3 changed files with 411 additions and 65 deletions.
75 changes: 62 additions & 13 deletions docs/tutorials/LeNet_5_EngChinese.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -70,7 +70,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -113,7 +113,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -136,7 +136,7 @@
"\n",
" # Setting up random seed to reproduce experiments\n",
" torch.manual_seed(0)\n",
" if device is not \"cpu\":\n",
" if device != \"cpu\":\n",
" torch.backends.cudnn.deterministic = True\n",
" torch.backends.cudnn.benchmark = False\n",
"\n",
Expand Down Expand Up @@ -191,7 +191,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -238,7 +238,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -314,7 +314,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -374,9 +374,31 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "61033e39895f412a9b9f79d76bd9ae60",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/2 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"ANN test accuracy: 98.12\n"
]
}
],
"source": [
"# Setting up environment\n",
"prepare()\n",
Expand All @@ -390,9 +412,31 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "229f9ddefaa64ca290a7dfb24c23a163",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/10000 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"SNN test accuracy: 98.40\n"
]
}
],
"source": [
"# Test on SNN model\n",
"snn_accuracy = snn_test(classifier, n_dt=10, n_test=2000)"
Expand All @@ -408,7 +452,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3.8.8 ('base')",
"language": "python",
"name": "python3"
},
Expand All @@ -422,7 +466,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.11"
"version": "3.8.8"
},
"vscode": {
"interpreter": {
"hash": "caf264bf03997fa53b380c84044763293a7a6f8ebb5555ee5243fd4d1f495be6"
}
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 27506c9

Please sign in to comment.