Show how to use the new visitors with lambdas (#2162)

This commit is contained in:
Adrià Arrufat 2020-09-06 22:27:50 +09:00 committed by GitHub
parent 393db2490b
commit 5ec60a91c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,7 +130,9 @@ int main(int argc, char** argv) try
// Instantiate both generator and discriminator
generator_type generator;
discriminator_type discriminator(leaky_relu_(0.2), leaky_relu_(0.2), leaky_relu_(0.2));
discriminator_type discriminator;
// setup all leaky_relu_ layers in the discriminator to have alpha = 0.2
visit_computational_layers(discriminator, [](leaky_relu_& l){ l = leaky_relu_(0.2); });
// Remove the bias learning from all bn_ inputs in both networks
set_all_bn_inputs_no_bias(generator);
set_all_bn_inputs_no_bias(discriminator);