tfl.kronecker_factored_lattice_lib.finalize_constraints

Approximately projects weights to strictly satisfy all constraints.

This projeciton guarantees that constraints are strictly met, but it is not an exact projection w.r.t. the L2 norm. The computational cost is O(num_monotonic_dims * num_lattice_weights).

See helper functions _approximately_project_* for details of the individual projection algorithms for each set of constraints.

weights Kronecker-Factored Lattice weights tensor of shape: (1, lattice_sizes, units * dims, num_terms).
units Number of units per input dimension.
scale Scale variable of shape: (units, num_terms).
monotonicities List or tuple of length dims of elements of {0,1} which represents monotonicity constraints per dimension. 1 stands for increasing (non-decreasing in fact), 0 for no monotonicity constraints.

Projected weights tensor of same shape as weights.