TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes.

A ConstrainedOptimizer based on swap-regret minimization.

This ConstrainedOptimizer uses the given tf.compat.v1.train.Optimizers to jointly minimize over the model parameters, and maximize over constraint/objective weight matrix (the analogue of Lagrange multipliers), with the latter maximization using additive updates and an algorithm that minimizes swap regret.

For more specifics, please refer to:

Cotter, Jiang and Sridharan. "Two-Player Games for Efficient Non-Convex Constrained Optimization". https://arxiv.org/abs/1804.06500

The formulation used by this optimizer can be found in Definition 2, and is discussed in Section 4. It is most similar to Algorithm 2 in Section 4, with the differences being that it uses tf.compat.v1.train.Optimizers, instead of SGD, for the "inner" updates, and performs additive (instead of multiplicative) updates of the stochastic matrix.

## __init__

View source

__init__(
optimizer,
constraint_optimizer=None
)

#### Args:

• optimizer: tf.compat.v1.train.Optimizer, used to optimize the objective and proxy_constraints portion of ConstrainedMinimizationProblem. If constraint_optimizer is not provided, this will also be used to optimize the Lagrange multiplier analogues.
• constraint_optimizer: optional tf.compat.v1.train.Optimizer, used to optimize the Lagrange multiplier analogues.

## Properties

### constraint_optimizer

Returns the tf.compat.v1.train.Optimizer used for the matrix.

### optimizer

Returns the tf.compat.v1.train.Optimizer used for optimization.

## Methods

### minimize

View source

minimize(
minimization_problem,
unconstrained_steps=None,
global_step=None,
var_list=None,
aggregation_method=None,
name=None,
)

Returns an Operation for minimizing the constrained problem.

This method combines the functionality of minimize_unconstrained and minimize_constrained. If global_step < unconstrained_steps, it will perform an unconstrained update, and if global_step >= unconstrained_steps, it will perform a constrained update.

The reason for this functionality is that it may be best to initialize the constrained optimizer with an approximate optimum of the unconstrained problem.

#### Returns:

Operation, the train_op.

#### Raises:

• ValueError: If unconstrained_steps is provided, but global_step is not.

### minimize_constrained

View source

minimize_constrained(
minimization_problem,
global_step=None,
var_list=None,
aggregation_method=None,
name=None,
)

Returns an Operation for minimizing the constrained problem.

Unlike minimize_unconstrained, this function attempts to find a solution that minimizes the objective portion of the minimization problem while satisfying the constraints portion.

#### Returns:

Operation, the train_op.

### minimize_unconstrained

View source

minimize_unconstrained(
minimization_problem,
global_step=None,
var_list=None,
aggregation_method=None,