LostTech.TensorFlow : API Documentation

Type ConstrainedOptimizer

Namespace tensorflow.contrib.constrained_optimization

Parent PythonObjectContainer

Interfaces IConstrainedOptimizer

Base class representing a constrained optimizer.

A ConstrainedOptimizer wraps a tf.compat.v1.train.Optimizer (or more than one), and applies it to a ConstrainedMinimizationProblem. Unlike a tf.compat.v1.train.Optimizer, which takes a tensor to minimize as a parameter to its minimize() method, a constrained optimizer instead takes a ConstrainedMinimizationProblem.

Methods

Properties

Public instance methods

object minimize(object minimization_problem, object unconstrained_steps, object global_step, object var_list, ImplicitContainer<T> gate_gradients, object aggregation_method, bool colocate_gradients_with_ops, string name, object grad_loss)

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.
Parameters
object minimization_problem
ConstrainedMinimizationProblem, the problem to optimize.
object unconstrained_steps
int, number of steps for which we should perform unconstrained updates, before transitioning to constrained updates.
object global_step
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object var_list
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
ImplicitContainer<T> gate_gradients
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object aggregation_method
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
bool colocate_gradients_with_ops
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
string name
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object grad_loss
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
Returns
object
`Operation`, the train_op.

object minimize_constrained(object minimization_problem, object global_step, object var_list, ImplicitContainer<T> gate_gradients, object aggregation_method, bool colocate_gradients_with_ops, string name, object grad_loss)

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.
Parameters
object minimization_problem
ConstrainedMinimizationProblem, the problem to optimize.
object global_step
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object var_list
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
ImplicitContainer<T> gate_gradients
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object aggregation_method
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
bool colocate_gradients_with_ops
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
string name
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object grad_loss
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
Returns
object
`Operation`, the train_op.

object minimize_constrained_dyn(object minimization_problem, object global_step, object var_list, ImplicitContainer<T> gate_gradients, object aggregation_method, ImplicitContainer<T> colocate_gradients_with_ops, object name, object grad_loss)

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.
Parameters
object minimization_problem
ConstrainedMinimizationProblem, the problem to optimize.
object global_step
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object var_list
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
ImplicitContainer<T> gate_gradients
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object aggregation_method
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
ImplicitContainer<T> colocate_gradients_with_ops
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object name
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object grad_loss
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
Returns
object
`Operation`, the train_op.

object minimize_dyn(object minimization_problem, object unconstrained_steps, object global_step, object var_list, ImplicitContainer<T> gate_gradients, object aggregation_method, ImplicitContainer<T> colocate_gradients_with_ops, object name, object grad_loss)

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.
Parameters
object minimization_problem
ConstrainedMinimizationProblem, the problem to optimize.
object unconstrained_steps
int, number of steps for which we should perform unconstrained updates, before transitioning to constrained updates.
object global_step
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object var_list
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
ImplicitContainer<T> gate_gradients
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object aggregation_method
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
ImplicitContainer<T> colocate_gradients_with_ops
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object name
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object grad_loss
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
Returns
object
`Operation`, the train_op.

object minimize_unconstrained(object minimization_problem, object global_step, object var_list, ImplicitContainer<T> gate_gradients, object aggregation_method, bool colocate_gradients_with_ops, string name, object grad_loss)

Returns an `Operation` for minimizing the unconstrained problem.

Unlike `minimize_constrained`, this function ignores the `constraints` (and `proxy_constraints`) portion of the minimization problem entirely, and only minimizes `objective`.
Parameters
object minimization_problem
ConstrainedMinimizationProblem, the problem to optimize.
object global_step
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object var_list
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
ImplicitContainer<T> gate_gradients
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object aggregation_method
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
bool colocate_gradients_with_ops
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
string name
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object grad_loss
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
Returns
object
`Operation`, the train_op.

object minimize_unconstrained_dyn(object minimization_problem, object global_step, object var_list, ImplicitContainer<T> gate_gradients, object aggregation_method, ImplicitContainer<T> colocate_gradients_with_ops, object name, object grad_loss)

Returns an `Operation` for minimizing the unconstrained problem.

Unlike `minimize_constrained`, this function ignores the `constraints` (and `proxy_constraints`) portion of the minimization problem entirely, and only minimizes `objective`.
Parameters
object minimization_problem
ConstrainedMinimizationProblem, the problem to optimize.
object global_step
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object var_list
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
ImplicitContainer<T> gate_gradients
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object aggregation_method
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
ImplicitContainer<T> colocate_gradients_with_ops
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object name
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
object grad_loss
as in `tf.compat.v1.train.Optimizer`'s `minimize` method.
Returns
object
`Operation`, the train_op.

Public properties

object optimizer get;

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

object optimizer_dyn get;

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

object PythonObject get;