add_weight_constraint

safe_learning.utilities.add_weight_constraint(optimization, var_list, bound_list)

Add weight constraints to an optimization step.

Parameters:
optimization : tf.Tensor

The optimization routine that updates the parameters.

var_list : list

A list of variables that should be bounded.

bound_list : list

A list of bounds (lower, upper) for each variable in var_list.

Returns:
assign_operations : list

A list of assign operations that correspond to one step of the constrained optimization.