Deep Convolutional Generative Adversarial Networks

PyTorch version:

I noticed that c065c0e2593b8b161a2d7873e42418bf6a21106c in

And all DATA_HUB have such numbers.
Where did these numbers come from? @goldpiggy
How can I produce these numbers

Why my image is not so clear?

Hey @StevenJokes, great question! This is the hash code for the dataset. Please see more details here.

(BTW the pokemon dataset will be deprecated in the future because of legal constraints. :()

hashlib.sha1() SHA1 hash. I got it .hashlib

read file:

                data = // MAX rows in EXCEL
                if not data:     // test if file is empty

1,048,576 rows—— a string (in text mode)= 2^20 rows = 2M rows
After 2007, EXCEL have 1,048,576 rows and end at XFD.
Problem: Excel CSV. file with more than 1,048,576 rows of data
How to fix it: Lazy Method for Reading Big File in Python?
Why 1,048,576 rows?:haven’t found yet.

fp.extractall(base_dir) //extract file

os.path.join(base_dir, folder) if folder else data_dir
add folder or data_dir to current path?
I noticed that BASE_DIR is used more fruently. Maybe we should change to it?


Despite being named Pokémon Database, currently we do not offer any database or API (Application Programming Interface) for use, though it may be something we offer in the future.
It should be noted here that we are unable to make a Pokémon app as Nintendo gets them taken down from all app stores.

I noticed it is CC-BY 4.0, or was?. Where is the legal constraints?
I look all dataset legal constraints searched, and I didn’t find any information about legal constraints of dataset. :sob: How can I confirm whether a dataset can be used for public.

Awesome Public Datasets on ML



Why didn’t the discriminator loss go up and the generator go down?
Why isn’t same as the 17.1 losses’ going together finally?

I think there is a bug:

After switching,


new PR:

But why is /2 + 0.5 , rather than other ways to normalize?

Why we need , 1, 1

Hey @StevenJokes. In MXNet, the dimension is like (batch_size, channel, height, width).

1 Like

We stated that " we normalize the data with 0.5 mean and 0.5 standard deviation to match the value range" in the earlier text.

Do you mean this?

Got you.

I’m not sure about DCGAN’s Discriminator‘s structure:

@goldpiggy, am I right?

Why do we need /2?
The code I’m contrasting with is from


I have translated this code to PyTorch, and it runs without crashing, but the network fails to train (both losses go way above 1, and the image is garbage).

Can you take a look at this file and see if there are any obvious mistakes?

Thank you!

For those who were confused like me about the figure discussion, it ended up being Section 17.1 that had the legend backwards rather than Section 17.2. But both sections are now correct in the main text.

OK. I’ll learn.

What is “it” you talked about?

Do you have ipynb file? It is easy to watch the result of every step.
I tried to translate but failed. You can take a look at this PR.

epoch is too small?
Why so slow?

You need to train more epochs by GPU.
It is quicker.

And thanks for your code BTW.
I think I already figure DCGAN out.

(Reply to this post)

Thank you! I found your ipynb notebook and converted it to a .py file. It is working great. I hope to make a cleaned up version of my file (I updated mine on the link I sent earlier to include GPU, and I think some of my arguments are named more cleanly) that still produces good results. This could be days or months before that happens, though.

What is “it” you talked about?

I’ve updated my post to include a link to the post I was following. For some reason, the software does not make it clear what you are linking to.

I don’t have Jupyter Notebook installed on my local machine – perhaps I should install that!

I’m trying to prepare for a pull request myself, and I’m running with GPU. I’ve updated the code I linked earlier (sorry, ran out of links for this post) to include GPU support. I followed’s chapter on GPUs in doing this.

(And now, a reply to the post right before this one):

Can you share the link to the code you used to create this figure? I suspect it is your code (not mine), but I’m confused as to why your code stops after a few iterations. By the way, I really like your GPU code. It is cleaner than mine. I’m going to try to make a clean version of my code that borrows heavily from yours.

It was my code I forget to add image
The code didn’t not stop.
Only running. I’m so excited to tell you and thanks for your code too.
Now you can check
It runs well.
If you like to research, my GAN repo which records my all code have tried:
Free to share with you.
And I created a discussion for DCGAN pytorch.
We can talk more about the code there.
Deep Convolutional Generative Adversarial Networks