Closed kfahn22 closed 6 months ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
View / edit / reply to this conversation on ReviewNB
merveenoyan commented on 2023-12-09T05:04:06Z ----------------------------------------------------------------
Again, having dataset hosted at hugging face gives you a lot of convenience with one line:
python
from datasets import load_dataset
ds = load_dataset(DATASET_ID)
View / edit / reply to this conversation on ReviewNB
merveenoyan commented on 2023-12-09T05:04:07Z ----------------------------------------------------------------
I think seeing one or two should be enough :')
View / edit / reply to this conversation on ReviewNB
merveenoyan commented on 2023-12-09T05:04:08Z ----------------------------------------------------------------
I think it would be nicer if we could visualize every x epochs
kfahn22 commented on 2023-12-16T00:19:13Z ----------------------------------------------------------------
done
I think using kaggle adds quite a lot of complexity. Overall the notebook is pretty informative. I'd like to have @MKhalusova add her views too!
View / edit / reply to this conversation on ReviewNB
MKhalusova commented on 2023-12-11T14:17:45Z ----------------------------------------------------------------
thanks fixed
View / edit / reply to this conversation on ReviewNB
johko commented on 2023-12-12T22:07:31Z ----------------------------------------------------------------
Do you know and can you add the hardware requirements people need to run the whole notebook including the training? Or at least if it is running in colab and with which GPU if you know that.
kfahn22 commented on 2023-12-16T00:44:23Z ----------------------------------------------------------------
Sorry, I am not exactly sure what you are saying. This notebook ran in High-Ram (although it took several hours)- is that what you are referring to?
MKhalusova commented on 2023-12-18T13:39:08Z ----------------------------------------------------------------
I agree with Johannes - it would be useful to add a note specifying what setup a learner might need to run this notebook (e.g. Google Colab with High RAM A100).
This is especially important when the free version of Colab is not enough to run the notebook (I think it's only T4, and no high-RAM).
This is something that would be great to add to all the notebooks (but especially the ones that won't run on the free tier)
View / edit / reply to this conversation on ReviewNB
johko commented on 2023-12-12T22:07:32Z ----------------------------------------------------------------
We will use we make use a utility function to plot the loaded images.
View / edit / reply to this conversation on ReviewNB
johko commented on 2023-12-12T22:07:33Z ----------------------------------------------------------------
-> And now let's look at lung images that have been labeled as pneumonia.
kfahn22 commented on 2023-12-16T00:30:58Z ----------------------------------------------------------------
I have to admit I really struggled trying to show the images after they were downloaded from the Hub. I am guessing there must be an easy way to do it, but I haven't figured it out. I can filter them to a folder, but that cell was taking A REALLY LONG TIME and I decided it wasn't worth it. I have settled on just showing one image. If you can tell me how to edit I will update.
View / edit / reply to this conversation on ReviewNB
johko commented on 2023-12-12T22:07:34Z ----------------------------------------------------------------
First, we us define some parameters.
View / edit / reply to this conversation on ReviewNB
johko commented on 2023-12-12T22:07:35Z ----------------------------------------------------------------
The model weights sare randomly....
View / edit / reply to this conversation on ReviewNB
merveenoyan commented on 2023-12-15T07:17:27Z ----------------------------------------------------------------
There's few typos here
kfahn22 commented on 2023-12-16T00:23:07Z ----------------------------------------------------------------
Have see the misspelling on preprocess. Are there others?
View / edit / reply to this conversation on ReviewNB
merveenoyan commented on 2023-12-15T07:17:27Z ----------------------------------------------------------------
You can add the citation at the bottom not to break the flow
View / edit / reply to this conversation on ReviewNB
merveenoyan commented on 2023-12-15T07:17:28Z ----------------------------------------------------------------
Would be better to have more intuitive naming for variables for better readability, e.g. generative_network or gen_net would be better
kfahn22 commented on 2023-12-18T19:32:11Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
merveenoyan commented on 2023-12-15T07:17:29Z ----------------------------------------------------------------
Line #14. ############################
You don't need to leave these
Done
I have to admit I really struggled trying to show the images after they were downloaded from the Hub. I am guessing there must be an easy way to do it, but I haven't figured it out. I can filter them to a folder, but that cell was taking A REALLY LONG TIME and I decided it wasn't worth it. I have settled on just showing one image. If you can tell me how to edit I will update.
View entire conversation on ReviewNB
I am sorry, I am not sure what this is referring to. Please let me know if I still need to fix.
View entire conversation on ReviewNB
Sorry, I am not exactly sure what you are saying. This notebook ran in High-Ram (although it took several hours)- is that what you are referring to?
View entire conversation on ReviewNB
I have substantially edit the notebook. I tried to address the comments, but I might have missed some things. Please let me know what I still need to update. Note that the results seem to be highly dependent on the seed value, which I am still finding hard to believe. At any rate, I changed the seed value to 22 (as much as a Hitchhiker's nerd as I am, 42 led to a poor outcome). Also, I am wondering if the model is suffering from mode collapse since at least to me the verified images look similar. I edited the mdx file to discuss this.
I have also added links to the training GIF and image showing the verified synthetic Xray images.
I agree with Johannes - it would be useful to add a note specifying what setup a learner might need to run this notebook (e.g. Google Colab with High RAM A100).
This is especially important when the free version of Colab is not enough to run the notebook (I think it's only T4, and no high-RAM).
This is something that would be great to add to all the notebooks (but especially the ones that won't run on the free tier)
View entire conversation on ReviewNB
View / edit / reply to this conversation on ReviewNB
MKhalusova commented on 2023-12-18T15:11:19Z ----------------------------------------------------------------
It would be nice to add a sentence or two about the transformations that you do when preprocessing the dataset.
View / edit / reply to this conversation on ReviewNB
MKhalusova commented on 2023-12-18T15:11:20Z ----------------------------------------------------------------
Line #12. # GPU or CPU (Not having at least 1 GPU can prevent code from working)
This is something that should be mentioned in the introduction
View / edit / reply to this conversation on ReviewNB
MKhalusova commented on 2023-12-18T15:11:21Z ----------------------------------------------------------------
Why not take a look at an image before making transformations?
kfahn22 commented on 2023-12-18T17:43:33Z ----------------------------------------------------------------
I have changed the code to display 4 normal images and 4 pneumonia images, but they are all big.
View / edit / reply to this conversation on ReviewNB
MKhalusova commented on 2023-12-18T15:11:22Z ----------------------------------------------------------------
Line #2. device = torch.device("cuda:0" if (torch.cuda.is_available() and nb_gpu > 0) else "cpu")
This might be redundant, you define the device earlier.
Fixed
View / edit / reply to this conversation on ReviewNB
MKhalusova commented on 2023-12-18T15:11:22Z ----------------------------------------------------------------
It's great that you have comments in the code, but it would also be helpful to have a quick description of what happens in the loop here, before the code.
View / edit / reply to this conversation on ReviewNB
MKhalusova commented on 2023-12-18T15:11:23Z ----------------------------------------------------------------
Add a couple of sentences about what we see here - whether this is what we expect to see or not, what conclusions can we make etc.
This is another opportunity to guide a learner to understand better what's going on. Share your knowledge :)
View / edit / reply to this conversation on ReviewNB
MKhalusova commented on 2023-12-18T15:11:24Z ----------------------------------------------------------------
Earlier in the notebook, you log in to Hugging Face Hub. It would make sense to push the model to Hub, and then, for inference, get it here from Hub.
kfahn22 commented on 2023-12-18T18:02:28Z ----------------------------------------------------------------
I thought about pushing the model to the Hub, but I wondered whether the model was good enough. I am exploring MedFusion, which first trains a VAE or VAEGAN and then trains further with a Diffusor.
View / edit / reply to this conversation on ReviewNB
MKhalusova commented on 2023-12-18T15:11:25Z ----------------------------------------------------------------
Again, a couple of words would be great about why we need the post-processing, what kind of post-processing is needed, etc..
View / edit / reply to this conversation on ReviewNB
MKhalusova commented on 2023-12-18T15:11:26Z ----------------------------------------------------------------
I'm not sure I understand what "verified" means in this context.
kfahn22 commented on 2023-12-18T20:09:59Z ----------------------------------------------------------------
I have changed the naming and added an explanation.
I have changed the code to display 4 normal images and 4 pneumonia images, but they are all big.
View entire conversation on ReviewNB
I thought about pushing the model to the Hub, but I wondered whether the model was good enough. I am exploring MedFusion, which first trains a VAE or VAEGAN and then trains further with a Diffusor.
View entire conversation on ReviewNB
Sorry this took me a while. I realized that in changing the code to download the dataset from the hub, I introduced a bug.
I think I have addressed all of the comments on the notebook. I have added a discussion on preprocessing, training, the plot, and "good" images. I also added a link to the notebook.
Please let me know if there is anything else--thank you!
This is a first draft for the section on generating lung images with DCGAN. Note that I am not thrilled with the quality of the lung images. I have started looking into Medfusion (which uses to diffusors) to see if the images can be improved, although not sure about the time-frame to implement.