Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Add 3d autoencoderkl tutorial#78

Merged
Warvito merged 13 commits intomainfrom
27-tutorial-autoencoderkl-3d
Dec 9, 2022
Merged

Add 3d autoencoderkl tutorial#78
Warvito merged 13 commits intomainfrom
27-tutorial-autoencoderkl-3d

Conversation

@JessyD
Copy link
Copy Markdown
Member

@JessyD JessyD commented Nov 27, 2022

Implement #27

@JessyD JessyD changed the title Add 3d autoencoder tutorial Add 3d autoencoderkl tutorial Nov 27, 2022
@JessyD JessyD marked this pull request as ready for review November 29, 2022 01:52
@SANCHES-Pedro SANCHES-Pedro self-requested a review November 29, 2022 12:24
Copy link
Copy Markdown
Contributor

@SANCHES-Pedro SANCHES-Pedro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good overall.

I expected a slightly different loss curve for the generator and discrimator of adversarial training. I would expect them to be more symmetrical. But I dont think that's an issue for the tutorial.

Comment thread tutorials/generative/3d_autoencoderkl/3d_autoencoderkl_tutorial.py Outdated
" bias=False,\n",
" padding=(1, 1, 1),\n",
")\n",
"discriminator.to(device)"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Optional)
I like to put a semicolon ( ; ) at the end to avoid printing too many things on the cell output. I would do:

discriminator.to(device);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried adding the semicolon but when I ran black it removed it.

Comment thread tutorials/generative/3d_autoencoderkl/3d_autoencoderkl_tutorial.py Outdated
@JessyD JessyD requested a review from SANCHES-Pedro December 4, 2022 18:05
@JessyD
Copy link
Copy Markdown
Member Author

JessyD commented Dec 4, 2022

@SANCHES-Pedro The code is ready to be reviewed again

@Warvito Warvito linked an issue Dec 5, 2022 that may be closed by this pull request
@Warvito Warvito self-requested a review December 6, 2022 11:09
Copy link
Copy Markdown
Collaborator

@Warvito Warvito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, it is just necessary to fix the usage of the variable channel

Comment thread tutorials/generative/3d_autoencoderkl/3d_autoencoderkl_tutorial.py Outdated
Comment thread tutorials/generative/3d_autoencoderkl/3d_autoencoderkl_tutorial.py
check_data = first(val_loader)
idx = 0

img = check_data["image"][idx, channel]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. the loader returns a image with format 2, 1, 96, 96, 64, if channel has a different value than 0 it will raise an error

Comment on lines +62 to +63
channel = 0 # 0 = Flair
assert channel in [0, 1, 2, 3], "Choose a valid channel"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is necessary to fix the usage of the variable channel. Currently, your dataloader returns an tensor with format (2, 1, 96, 96, 64) and there is a lot of places where you use [idx, channel]. This will create an error if you change the channel value for anything different from 0.

Comment thread tutorials/generative/3d_autoencoderkl/3d_autoencoderkl_tutorial.py Outdated
Comment thread tutorials/generative/3d_autoencoderkl/3d_autoencoderkl_tutorial.py Outdated
Comment thread tutorials/generative/3d_autoencoderkl/3d_autoencoderkl_tutorial.py Outdated
@Warvito Warvito merged commit 739b50d into main Dec 9, 2022
@Warvito Warvito deleted the 27-tutorial-autoencoderkl-3d branch December 12, 2022 19:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tutorial training AEKL with 3D data

3 participants