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]
4848#
4949
5050# %% [markdown]
51- # ## Setup environment
51+ # ## Setup environment
5252
5353# %%
5454# !python -c "import monai" || pip install -q "monai-weekly[tqdm]"
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}
198199class 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# %%
413414nb = 8
@@ -421,7 +422,7 @@ def forward(self, xt, x_cond, t):
421422plt .figure (figsize = (15 , 5 ))
422423plt .imshow (grid .detach ().cpu ().numpy ()[0 ], cmap = "gray" )
423424plt .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# %%
427428if directory is None :
0 commit comments