Skip to content

Commit c748e24

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f0bb2e5 commit c748e24

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

generation/2d_diffusion_autoencoder/2d_diffusion_autoencoder_tutorial.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
# ---
1515

1616
# %% [markdown]
17-
# Copyright (c) MONAI Consortium
18-
# Licensed under the Apache License, Version 2.0 (the "License");
19-
# you may not use this file except in compliance with the License.
20-
# You may obtain a copy of the License at
21-
#     http://www.apache.org/licenses/LICENSE-2.0
22-
# Unless required by applicable law or agreed to in writing, software
23-
# distributed under the License is distributed on an "AS IS" BASIS,
24-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25-
# See the License for the specific language governing permissions and
17+
# Copyright (c) MONAI Consortium
18+
# Licensed under the Apache License, Version 2.0 (the "License");
19+
# you may not use this file except in compliance with the License.
20+
# You may obtain a copy of the License at
21+
#     http://www.apache.org/licenses/LICENSE-2.0
22+
# Unless required by applicable law or agreed to in writing, software
23+
# distributed under the License is distributed on an "AS IS" BASIS,
24+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25+
# See the License for the specific language governing permissions and
2626
# limitations under the License.
2727

2828
# %% [markdown]
@@ -48,7 +48,7 @@
4848
#
4949

5050
# %% [markdown]
51-
# ## Setup environment
51+
# ## Setup environment
5252

5353
# %%
5454
# !python -c "import monai" || pip install -q "monai-weekly[tqdm]"
@@ -194,6 +194,7 @@
194194
# The `embedding_dimension` parameter controls the dimension of the latent dimension learned by the semantic encoder.
195195
#
196196

197+
197198
# %% jupyter={"outputs_hidden": false}
198199
class Diffusion_AE(torch.nn.Module):
199200
def __init__(self, embedding_dimension=64):
@@ -407,7 +408,7 @@ def forward(self, xt, x_cond, t):
407408
)
408409

409410
# %% [markdown]
410-
# Although not perfectly, the manipulated slices do not present a tumour (unlike the middle - "reconstructed" - ones), because we tweaked the latents to move away from the abnormality cluster:
411+
# Although not perfectly, the manipulated slices do not present a tumour (unlike the middle - "reconstructed" - ones), because we tweaked the latents to move away from the abnormality cluster:
411412

412413
# %%
413414
nb = 8
@@ -421,7 +422,7 @@ def forward(self, xt, x_cond, t):
421422
plt.figure(figsize=(15, 5))
422423
plt.imshow(grid.detach().cpu().numpy()[0], cmap="gray")
423424
plt.axis("off")
424-
plt.title(f"Original (top), Reconstruction (middle), Manipulated (bottom) s = {s}");
425+
plt.title(f"Original (top), Reconstruction (middle), Manipulated (bottom) s = {s}")
425426

426427
# %%
427428
if directory is None:

0 commit comments

Comments
 (0)