tf.contrib.gan.cyclegan_model(
generator_fn,
discriminator_fn,
data_x,
data_y,
generator_scope='Generator',
discriminator_scope='Discriminator',
model_x2y_scope='ModelX2Y',
model_y2x_scope='ModelY2X',
check_shapes=True
)
Defined in tensorflow/contrib/gan/python/train.py
.
Returns a CycleGAN model outputs and variables.
See https://arxiv.org/abs/1703.10593 for more details.
Args:
generator_fn
: A python lambda that takesdata_x
ordata_y
as inputs and returns the outputs of the GAN generator.discriminator_fn
: A python lambda that takesreal_data
/generated data
andgenerator_inputs
. Outputs a Tensor in the range [-inf, inf].data_x
: ATensor
of dataset X. Must be the same shape asdata_y
.data_y
: ATensor
of dataset Y. Must be the same shape asdata_x
.generator_scope
: Optional generator variable scope. Useful if you want to reuse a subgraph that has already been created. Defaults to 'Generator'.discriminator_scope
: Optional discriminator variable scope. Useful if you want to reuse a subgraph that has already been created. Defaults to 'Discriminator'.model_x2y_scope
: Optional variable scope for model x2y variables. Defaults to 'ModelX2Y'.model_y2x_scope
: Optional variable scope for model y2x variables. Defaults to 'ModelY2X'.check_shapes
: IfTrue
, check that generator produces Tensors that are the same shape asdata_x
(data_y
). Otherwise, skip this check.
Returns:
A CycleGANModel
namedtuple.
Raises:
ValueError
: Ifcheck_shapes
is True anddata_x
or the generator output does not have the same shape asdata_y
.