class_docstr: A `Learner` suitable for GANs.
class_docstr_tok: ["A","`","Learner","`","suitable","for","GANs","."]
docstr: Create a GAN from `learn_gen` and `learn_crit`.
docstr_tok: ["Create","a","GAN","from","`","learn_gen","`","and","`","learn_crit","`","."]
code: def from_learners(
      cls,
      gen_learn: Learner,  # A `Learner` object that contains the generator
      crit_learn: Learner,  # A `Learner` object that contains the critic
      switcher: Callback
      | None = None,  # Callback for switching between generator and critic training, defaults to `FixedGANSwitcher`
      weights_gen: None
      | MutableSequence
      | tuple = None,  # Weights for the generator and critic loss function
      **kwargs,
  ):
      "Create a GAN from `learn_gen` and `learn_crit`."
      losses = gan_loss_from_func(
          gen_learn.loss_func,
          crit_learn.loss_func,
          weights_gen=weights_gen,
      )
      return cls(
          gen_learn.dls,
          gen_learn.model,
          crit_learn.model,
          *losses,
          switcher=switcher,
          **kwargs,
      )
  
imports: from __future__ import annotations
  from ..basics import *
  from .all import *
label_desc: Use image node_id 2 for calling the GANLearner obj's underlying member method code with example usage: obj.from_learners(cls, gen_learn, crit_learn, switcher, weights_gen) and returns: cls