From the fastai/gan.py, I see that the method to create a GANLearner from_learners contains this:
@classmethod def from_learners(cls, learn_gen:Learner, learn_crit:Learner, switcher:Callback=None, weights_gen:Tuple[float,float]=None, **learn_kwargs): "Create a GAN from `learn_gen` and `learn_crit`." losses = gan_loss_from_func(learn_gen.loss_func, learn_crit.loss_func, weights_gen=weights_gen) return cls(learn_gen.data, learn_gen.model, learn_crit.model, *losses, switcher=switcher, **learn_kwargs)
My issue is that learn_crit.data gets completely discarded, if I’m not mistaken, here.
But then what is the proper way to get the data needed by the critic? (i.e. the images). My generator needs some information (and I have a custom databunch for it), but my critic needs some other, completely different information, in addition to the outputs of the generator.
So right now I think I’m going to create a databunch that produces both the info needed by the generator and the info needed by the critic, custom loss functions that just discard all unneeded information, and so on. It seems… wasteful.