Skip to content

Commit

Permalink
Clean up redundant function
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenvivek committed Jan 28, 2024
1 parent 9cc34cb commit 4329ce2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 38 deletions.
2 changes: 1 addition & 1 deletion diffpose/deepfluoro.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def get_random_offset(batch_size: int, device) -> RigidTransform:
"se3_exp_map",
)

# %% ../notebooks/api/00_deepfluoro.ipynb 33
# %% ../notebooks/api/00_deepfluoro.ipynb 32
from torchvision.transforms import Compose, Lambda, Normalize, Resize


Expand Down
2 changes: 1 addition & 1 deletion diffpose/ljubljana.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def get_random_offset(view, batch_size: int, device) -> RigidTransform:
t1 = torch.distributions.Normal(75, 30).sample((batch_size,))
t2 = torch.distributions.Normal(-80, 30).sample((batch_size,))
t3 = torch.distributions.Normal(-5, 30).sample((batch_size,))
r1 = torch.distributions.Normal(0.0, 0.1).sample((batch_size,))
r1 = torch.distributions.Normal(0, 0.1).sample((batch_size,))
r2 = torch.distributions.Normal(0, 0.05).sample((batch_size,))
r3 = torch.distributions.Normal(1.55, 0.05).sample((batch_size,))
else:
Expand Down
35 changes: 0 additions & 35 deletions notebooks/api/00_deepfluoro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -732,41 +732,6 @@
" )"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e14ac65e-3c57-4c67-be3a-1d7184f669b3",
"metadata": {},
"outputs": [],
"source": [
"@beartype\n",
"def get_random_offset(view, batch_size: int, device) -> RigidTransform:\n",
" if view == \"ap\":\n",
" t1 = torch.distributions.Normal(-6, 20).sample((batch_size,))\n",
" t2 = torch.distributions.Normal(175, 30).sample((batch_size,))\n",
" t3 = torch.distributions.Normal(-5, 15).sample((batch_size,))\n",
" r1 = torch.distributions.Normal(0, 0.1).sample((batch_size,))\n",
" r2 = torch.distributions.Normal(0, 0.1).sample((batch_size,))\n",
" r3 = torch.distributions.Normal(-0.15, 0.25).sample((batch_size,))\n",
" elif view == \"lat\":\n",
" t1 = torch.distributions.Normal(75, 15).sample((batch_size,))\n",
" t2 = torch.distributions.Normal(-80, 20).sample((batch_size,))\n",
" t3 = torch.distributions.Normal(-5, 10).sample((batch_size,))\n",
" r1 = torch.distributions.Normal(0.0, 0.1).sample((batch_size,))\n",
" r2 = torch.distributions.Normal(0, 0.05).sample((batch_size,))\n",
" r3 = torch.distributions.Normal(1.55, 0.05).sample((batch_size,))\n",
" else:\n",
" raise ValueError(f\"view must be 'ap' or 'lat', not '{view}'\")\n",
"\n",
" logmap = torch.stack([r1, r2, r3, t1, t2, t3], dim=1).to(device)\n",
" T = convert(\n",
" [logmap[..., :3], logmap[..., 3:]],\n",
" \"se3_log_map\",\n",
" \"se3_exp_map\",\n",
" )\n",
" return T"
]
},
{
"cell_type": "markdown",
"id": "76efedd3-103c-43dd-944b-fe0c06e2c87b",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/api/01_ljubljana.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
" t1 = torch.distributions.Normal(75, 30).sample((batch_size,))\n",
" t2 = torch.distributions.Normal(-80, 30).sample((batch_size,))\n",
" t3 = torch.distributions.Normal(-5, 30).sample((batch_size,))\n",
" r1 = torch.distributions.Normal(0.0, 0.1).sample((batch_size,))\n",
" r1 = torch.distributions.Normal(0, 0.1).sample((batch_size,))\n",
" r2 = torch.distributions.Normal(0, 0.05).sample((batch_size,))\n",
" r3 = torch.distributions.Normal(1.55, 0.05).sample((batch_size,))\n",
" else:\n",
Expand Down

0 comments on commit 4329ce2

Please sign in to comment.