Unverified Commit 5a715fe2 authored by Adrià Arrufat's avatar Adrià Arrufat Committed by GitHub
Browse files

Remove outdated comment from DCGAN example (#2048)

* Remove outdated comment

That comment was there from when I was using a dnn_trainer to train
the discriminator network.

* Fix case
parent 237746fc
...@@ -198,18 +198,18 @@ int main(int argc, char** argv) try ...@@ -198,18 +198,18 @@ int main(int argc, char** argv) try
discriminator.update_parameters(d_solvers, learning_rate); discriminator.update_parameters(d_solvers, learning_rate);
// Train the discriminator with fake images // Train the discriminator with fake images
// 1. generate some random noise // 1. Generate some random noise
std::vector<noise_t> noises; std::vector<noise_t> noises;
while (noises.size() < minibatch_size) while (noises.size() < minibatch_size)
{ {
noises.push_back(make_noise(rnd)); noises.push_back(make_noise(rnd));
} }
// 2. convert noises into a tensor // 2. Convert noises into a tensor
generator.to_tensor(noises.begin(), noises.end(), noises_tensor); generator.to_tensor(noises.begin(), noises.end(), noises_tensor);
// 3. Then forward the noise through the network and convert the outputs into images. // 3. Forward the noise through the network and convert the outputs into images.
const auto fake_samples = get_generated_images(generator.forward(noises_tensor)); const auto fake_samples = get_generated_images(generator.forward(noises_tensor));
// 4. finally train the discriminator and wait for the threading to stop. The following // 4. Finally train the discriminator. The following lines are equivalent to calling
// lines are equivalent to calling train_one_step(fake_samples, fake_labels) // train_one_step(fake_samples, fake_labels)
discriminator.to_tensor(fake_samples.begin(), fake_samples.end(), fake_samples_tensor); discriminator.to_tensor(fake_samples.begin(), fake_samples.end(), fake_samples_tensor);
d_loss.add(discriminator.compute_loss(fake_samples_tensor, fake_labels.begin())); d_loss.add(discriminator.compute_loss(fake_samples_tensor, fake_labels.begin()));
discriminator.back_propagate_error(fake_samples_tensor); discriminator.back_propagate_error(fake_samples_tensor);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment