class_docstr: A `Learner` suitable for GANs.
class_docstr_tok: ["A","`","Learner","`","suitable","for","GANs","."]
docstr: Create a [WGAN](https://arxiv.org/abs/1701.07875) from `dls`, `generator` and `critic`.
docstr_tok: ["Create","a","[","WGAN","]","(","https",":","\/\/arxiv.org\/abs\/1701.07875",")","from","`","dls","`",",","`","generator","`","and","`","critic","`","."]
code: def wgan(
      cls,
      dls: DataLoaders,  # DataLoaders object for GAN data
      generator: nn.Module,  # Generator model
      critic: nn.Module,  # Critic model
      switcher: Callback
      | None = None,  # Callback for switching between generator and critic training, defaults to `FixedGANSwitcher(n_crit=5, n_gen=1)`
      clip: None | float = 0.01,  # How much to clip the weights
      switch_eval: bool = False,  # Whether the model should be set to eval mode when calculating loss
      **kwargs,
  ):
      "Create a [WGAN](https://arxiv.org/abs/1701.07875) from `dls`, `generator` and `critic`."
      if switcher is None:
          switcher = FixedGANSwitcher(n_crit=5, n_gen=1)
      return cls(
          dls,
          generator,
          critic,
          _tk_mean,
          _tk_diff,
          switcher=switcher,
          clip=clip,
          switch_eval=switch_eval,
          **kwargs,
      )
  
imports: from __future__ import annotations
  from ..basics import *
  from .all import *
label_desc: Use image node_id 3 for calling the GANLearner obj's underlying member method code with example usage: obj.wgan(cls, dls, generator, critic, switcher, clip, switch_eval) and returns: cls