tf.contrib.distribute.StandardSingleLossStep

Class StandardSingleLossStep

Inherits From: StandardInputStep

Defined in tensorflow/contrib/distribute/python/step_fn.py.

A step function that implements a training step for a feed forward network.

An instance of this class is intended to be used as a callable:

...
step = step_fn.StandardSingleLossStep(dataset, loss_fn, optimizer)
step.initialize(distribution)

.html# Run a single training step on a given DistributionStrategy:
step(distribution)
...

Args:

  • input_dataset: a tf.data Dataset that provides input.
  • loss_fn: a function that returns loss.
  • optimizer: an optimizer that implements an update rule.
  • distribution: a DistributionStrategy object.

Properties

distribution

Methods

__init__

__init__(
    input_dataset,
    loss_fn,
    optimizer,
    distribution
)

Initialize self. See help(type(self)) for accurate signature.

__call__

__call__()

Perform one step of this training algorithm.

inputs

inputs()

For the generating the input to be passed to step().

step

step(inputs)

Perform the main computation of this training algorithm.