|
pulsatrix
|
E-GAN's own full generational training loop (Wang et al. 2019): each generation, every population member independently attempts every given mutation objective (Phase 5 Mission 1) via a fresh weight-copy offspring, keeps whichever mutation scored the best combined fitness, then the shared discriminator trains on a real batch plus the (now-mutated) population's own pooled fake output (Phase 5 Mission 0). More...
#include <limits>#include <memory>#include <random>#include <stdexcept>#include <vector>#include "pulsatrix/bce_with_logits_loss.hpp"#include "pulsatrix/egan_mutation.hpp"#include "pulsatrix/generator_population.hpp"#include "pulsatrix/sgd_optimizer.hpp"
Go to the source code of this file.
Namespaces | |
| namespace | pulsatrix |
Functions | |
| template<typename MakeGenerator , typename DOptimizerT > | |
| std::vector< float > | pulsatrix::RunEGANGeneration (GeneratorPopulation &population, Module &discriminator, const Tensor &real_batch, const std::vector< Tensor > &noise_per_generator, const std::vector< MutationObjective > &objectives, MakeGenerator make_generator, float g_learning_rate, DOptimizerT &d_optimizer, DeviceBackend *backend, float gamma=0.05f) |
| Runs one E-GAN generation: for every population member, attempts every objective in objectives (each against a fresh weight-copy offspring built by make_generator + RestoreParameters), keeps the best-combined-fitness offspring, replaces that population slot with it, then trains discriminator on real_batch plus the now-mutated population's own pooled fake output. | |
| template<typename MakeGenerator , typename DOptimizerT , typename RNG > | |
| void | pulsatrix::RunEGANTraining (GeneratorPopulation &population, Module &discriminator, const Tensor &real_batch, int num_generations, int64_t noise_dim, int64_t per_generator_batch, const std::vector< MutationObjective > &objectives, MakeGenerator make_generator, float g_learning_rate, DOptimizerT &d_optimizer, DeviceBackend *backend, RNG &rng, float gamma=0.05f) |
| RNG-driven wrapper: draws fresh standard-normal noise for every population member every generation, then runs RunEGANGeneration num_generations times. | |
E-GAN's own full generational training loop (Wang et al. 2019): each generation, every population member independently attempts every given mutation objective (Phase 5 Mission 1) via a fresh weight-copy offspring, keeps whichever mutation scored the best combined fitness, then the shared discriminator trains on a real batch plus the (now-mutated) population's own pooled fake output (Phase 5 Mission 0).