diff --git a/generation/2d_diffusion_autoencoder/2d_diffusion_autoencoder_tutorial.py b/generation/2d_diffusion_autoencoder/2d_diffusion_autoencoder_tutorial.py index abcb35ee7..063ed44d4 100644 --- a/generation/2d_diffusion_autoencoder/2d_diffusion_autoencoder_tutorial.py +++ b/generation/2d_diffusion_autoencoder/2d_diffusion_autoencoder_tutorial.py @@ -14,15 +14,15 @@ # --- # %% [markdown] -# Copyright (c) MONAI Consortium -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -#     http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and +# Copyright (c) MONAI Consortium +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +#     http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and # limitations under the License. # %% [markdown] @@ -48,7 +48,7 @@ # # %% [markdown] -# ## Setup environment +# ## Setup environment # %% # !python -c "import monai" || pip install -q "monai-weekly[tqdm]" @@ -194,6 +194,7 @@ # The `embedding_dimension` parameter controls the dimension of the latent dimension learned by the semantic encoder. # + # %% jupyter={"outputs_hidden": false} class Diffusion_AE(torch.nn.Module): def __init__(self, embedding_dimension=64): @@ -407,7 +408,7 @@ def forward(self, xt, x_cond, t): ) # %% [markdown] -# 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: +# 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: # %% nb = 8 @@ -421,7 +422,7 @@ def forward(self, xt, x_cond, t): plt.figure(figsize=(15, 5)) plt.imshow(grid.detach().cpu().numpy()[0], cmap="gray") plt.axis("off") -plt.title(f"Original (top), Reconstruction (middle), Manipulated (bottom) s = {s}"); +plt.title(f"Original (top), Reconstruction (middle), Manipulated (bottom) s = {s}") # %% if directory is None: