GANLearner_wgan: Wgan

Description Usage Arguments Value Examples

View source: R/GAN.R

Description

Create a WGAN from 'data', 'generator' and 'critic'.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
GANLearner_wgan(
  dls,
  generator,
  critic,
  switcher = NULL,
  clip = 0.01,
  switch_eval = FALSE,
  gen_first = FALSE,
  show_img = TRUE,
  cbs = NULL,
  metrics = NULL,
  opt_func = Adam(),
  lr = 0.001,
  splitter = trainable_params,
  path = NULL,
  model_dir = "models",
  wd = NULL,
  wd_bn_bias = FALSE,
  train_bn = TRUE,
  moms = list(0.95, 0.85, 0.95)
)

Arguments

dls

dataloader

generator

generator

critic

critic

switcher

switcher

clip

clip value

switch_eval

switch evaluation

gen_first

generator first

show_img

show image or not

cbs

callbacks

metrics

metrics

opt_func

optimization function

lr

learning rate

splitter

splitter

path

path

model_dir

model directory

wd

weight decay

wd_bn_bias

weight decay bn bias

train_bn

It controls if BatchNorm layers are trained even when they are supposed to be frozen according to the splitter.

moms

momentums

Value

None

Examples

1
2
3
4
5
6
## Not run: 

learn = GANLearner_wgan(dls, generator, critic, opt_func = partial(Adam(), mom=0.))


## End(Not run)

fastai documentation built on July 28, 2021, 5:06 p.m.