Skip to content

Commit

Permalink
Rerun and reproduce some tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenvivek committed Jun 30, 2024
1 parent 389acd0 commit df61a32
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 424 deletions.
23 changes: 11 additions & 12 deletions notebooks/tutorials/introduction.ipynb

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions notebooks/tutorials/metrics.ipynb

Large diffs are not rendered by default.

75 changes: 39 additions & 36 deletions notebooks/tutorials/reconstruction.ipynb

Large diffs are not rendered by default.

451 changes: 99 additions & 352 deletions notebooks/tutorials/registration.ipynb

Large diffs are not rendered by default.

55 changes: 39 additions & 16 deletions notebooks/tutorials/timing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"12.7 ms ± 1.48 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
"6.64 ms ± 441 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
]
}
],
"source": [
"# |cuda\n",
"height = 100\n",
"\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0).to(device)\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0).to(device=device, dtype=torch.float32)\n",
"%timeit drr(pose)\n",
"del drr"
]
Expand All @@ -90,15 +90,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"48 ms ± 79 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
"24.6 ms ± 15.9 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
]
}
],
"source": [
"# |cuda\n",
"height = 200\n",
"\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0).to(device)\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0).to(device=device, dtype=torch.float32)\n",
"%timeit drr(pose)\n",
"del drr"
]
Expand All @@ -113,15 +113,38 @@
"name": "stdout",
"output_type": "stream",
"text": [
"104 ms ± 93.7 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
"51.1 ms ± 21.9 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
]
}
],
"source": [
"# |cuda\n",
"height = 300\n",
"\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0).to(device)\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0).to(device=device, dtype=torch.float32)\n",
"%timeit drr(pose)\n",
"del drr"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "866e3c73-f4c1-44a2-99d5-952edc2abe19",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"88 ms ± 79.4 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
]
}
],
"source": [
"# |cuda\n",
"height = 400\n",
"\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0).to(device=device, dtype=torch.float32)\n",
"%timeit drr(pose)\n",
"del drr"
]
Expand Down Expand Up @@ -156,16 +179,16 @@
"name": "stdout",
"output_type": "stream",
"text": [
"296 ms ± 229 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
"105 ms ± 83.1 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
]
}
],
"source": [
"# |cuda\n",
"height = 600\n",
"patch_size = 150\n",
"height = 500\n",
"patch_size = 250\n",
"\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0, patch_size=patch_size).to(device)\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0, patch_size=patch_size).to(device=device, dtype=torch.float32)\n",
"%timeit drr(pose)\n",
"del drr"
]
Expand All @@ -180,7 +203,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"427 ms ± 419 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
"217 ms ± 68.4 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
]
}
],
Expand All @@ -189,7 +212,7 @@
"height = 750\n",
"patch_size = 150\n",
"\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0, patch_size=patch_size).to(device)\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0, patch_size=patch_size).to(device=device, dtype=torch.float32)\n",
"%timeit drr(pose)\n",
"del drr"
]
Expand All @@ -204,7 +227,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"693 ms ± 1.27 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
"341 ms ± 310 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
]
}
],
Expand All @@ -213,7 +236,7 @@
"height = 1000\n",
"patch_size = 250\n",
"\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0, patch_size=patch_size).to(device)\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0, patch_size=patch_size).to(device=device, dtype=torch.float32)\n",
"%timeit drr(pose)\n",
"del drr"
]
Expand All @@ -228,7 +251,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"1.46 s ± 3.72 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
"717 ms ± 794 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
]
}
],
Expand All @@ -237,7 +260,7 @@
"height = 1500\n",
"patch_size = 250\n",
"\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0, patch_size=patch_size).to(device)\n",
"drr = DRR(subject, sdd=1020, height=height, delx=2.0, patch_size=patch_size).to(device=device, dtype=torch.float32)\n",
"%timeit drr(pose)\n",
"del drr"
]
Expand Down

0 comments on commit df61a32

Please sign in to comment.