File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -207,9 +207,9 @@ def animate(i):
207
207
208
208
209
209
210
- N = 8
211
- D_in = 1
212
- H = 4
210
+ N = 8 # batch size
211
+ D_in = 1 # input size of D
212
+ H = 4 # numbr of hidden neurons
213
213
D_out = 1
214
214
learning_rate = 0.005
215
215
epochs = 10000
@@ -292,12 +292,12 @@ def animate(i):
292
292
lr_decay_epochs = 150 )
293
293
294
294
############################
295
- # (2) Update G network: maximize log(D(G(z)))
295
+ # (2) Update G network: maximize log(D(G(z))): guide D make wrong prediction: G(z) --> real_label(1)
296
296
###########################
297
297
netG .zero_grad ()
298
298
labelv = Variable (label .fill_ (real_label ))
299
299
output = netD (fake ) # D(G(z))
300
- errG = criterion (output , labelv )
300
+ errG = criterion (output , labelv )
301
301
errG .backward ()
302
302
D_G_z2 = output .data .mean ()
303
303
optimizerG .step ()
Original file line number Diff line number Diff line change
1
+ pip install -r requirements.txt
2
+ pip install datetime
3
+ pip3 install torch torchvision # or use `conda install pytorch torchvision -c pytorch`
Original file line number Diff line number Diff line change
1
+ matplotlib == 1.5.3
2
+ numpy == 1.11.3
3
+ scipy == 0.17.0
4
+ seaborn == 0.7.1
5
+ tensorflow == 1.2.0
You can’t perform that action at this time.
0 commit comments