Description
Machine Learning HW6
ML TAs
Outline
1. Task introduction
2. Dataset & Submit format
3. Submission & Grading
4. Useful information
Task introduction
Generator
Task introduction – GAN
1. When you want to project some random variables into specific space
Discriminator
Random variable:
Random variable:
2. GAN structure: Generator and Discriminator
Task introduction – Anime face generation
Random variable:
1. Input: random number
2. Output: Anime face
3. Implementation requirement: DCGAN & WGAN & WGAN-GP
4. Target: generate 1000 anime face images
Task introduction – Evaluation metrics
Fake image
(Generate by yourself)
mean, std
mean, std
Real image
features
features
FID (Frechet Inception Distance) score
1. Use another model to create features for real and fake images
2. Calculate the Frechet distance between distribution of two features
Task introduction – Evaluation metrics
AFD (Anime face detection) rate
1. To detect how many anime faces in your submission
2. The higher, the better
Dataset & Summit format
Dataset & Submit format
Crypko
1. Website which can generate anime face by yourself
2. Thanks Arvin Liu for collecting the dataset
3. Website Link
Dataset & Submit format
Crypko
faces |
|__0.jpg
|__1.jpg
|__2.jpg
…
1. Dataset link is in the colab
2. Dataset format
3. There are 71,314 pictures in the folder
4. You can use additional datas to increase the performance*
*If you use additional data, please keep the relevant data and we reserve the right to verify additional data.
Submission & Grading
Submission & Grading
1. You should generate 1000 images, and name each image <number>.jpg a. e.g. 1.jpg, 2.jpg, … , 1000.jpg
2. Use tar to compress your images, and name the file with .tgz as extension.
3. The untarred files should not contain the folder.
4. The compressing code is provided in the sample code.
5. Sample script: cd <the images folder> && tar -zcvf ../images.tgz *.jpg
6. The folder containing your generated images should only contain 1000 images.
Submission & Grading – JudgeBoi General Rules
● 5 submission quota per day, reset at midnight.
○ Users not in the whitelist will have no quota.
● The countdown timer on the homepage is for reference only.
● We do limit the number of connections and request rate for each IP.
○ If you cannot access the website temporarily, please wait a moment.
○ If this prevents uploads, we do not offer additional opportunities for remediation
● Please do not attempt to attack JudgeBoi.
● For any JudgeBoi issues, please post on NTUCOOL discussion
○ Discussion Link: https://cool.ntu.edu.tw/courses/11666/discussion_topics/91777
Submission & Grading – JudgeBoi HW6-Specific Rules
● Only *.tgz file is allowed, file size should be smaller than 2MB.
● You can only select one submission since there is no private score.
○ If none of the submissions is selected, we will use the first submission.
● JudgeBoi should complete the evaluation within one minute.
○ You do not need to wait for the progress bar to finish
● Please DO NOT directly upload the anime pictures from internet
Submission & Grading
● Leaderboard: JudgeBoi (4%)
● Code submission: NTU COOL (2%)
● Report submission: Gradescope (4%)
Submission & Grading – Leaderboard
Score Name FID score AFD rate
1% Simple baseline FID ≤ 30000 AFD ≥ 0
1% Medium baseline FID ≤ 12000 AFD ≥ 0.4
1% Strong baseline FID ≤ 10000 AFD ≥ 0.5
1% Boss baseline FID ≤ 9000 AFD ≥ 0.6
Submission & Grading – Leaderboard
Baseline Suggestion Estimated time
Simple baseline Use sample code(DCGAN) < 1 hour
Medium baseline Use DCGAN with more epochs 1 ~ 1.5 hours
Strong baseline Use WGAN or WGAN-GP 2 ~ 3 hours
Boss baseline StyleGAN < 5 hours
Submission & Grading – NTU COOL
1. Compress the code, and submit to NTU COOL, the format is show below Ex: <student_id>_hw6.zip
Submission & Grading – Gradescope
Report questions:
1. Describe the difference between WGAN* and GAN**, list at least two differences
2. Please plot the “Gradient norm” result.
a. Use training dataset, set the number of discriminator layer to 4 (minimum requirement)
b. Plot two setting:
i. weight clipping
ii. gradient penalty
c. Y-axis: gradient norm(log scale), X-axis: discriminator layer number (from low to high)
*WGAN paper
**GAN paper
Submission & Grading – Gradescope
Report submission:
1. Submit the files on gradescope
Regulations
● You should NOT plagiarize, if you use any other resource, you should cite it in the reference.
● You should NOT modify your prediction files manually.
● Do NOT share codes or prediction files with any living creatures.
● Do NOT use any approaches to submit your results more than 5 times a day. Do NOT use additional data or pre-trained models.
● Your assignment will not be graded and your final grade x 0.9 if you violate any of the above rules.
● Prof. Lee & TAs preserve the rights to change the rules & grades.
Useful information
DCGAN
1. Sample code implementation
2. Use serveral conv layers to generate image
Generator: Discriminator:
fake/
x=2022real
WGAN & WGAN-GP
1. WGAN: Modify from DCGAN
a. Remove the last sigmoid layer from the discriminator.
b. Do not take the logarithm when calculating the loss.
c. Clip the weights of the discriminator to a constant (1 ~ -1).
d. Use RMSProp or SGD as the optimizer.
e. Link
2. WGAN-GP: Modify from WGAN
a. Use gradient penalty to replace weight clipping
b. Gradient penalty accumulate gradient from an interpolated image
c. Link
StyleGAN
1. StyleGAN
a. First transform latent variable z to w
b. Use w in different stage in generator
(Deal with different resolutions)
c. Useful link
Link
Colab
Reviews
There are no reviews yet.