View source on GitHub |
Approximately projects weights to strictly satisfy all constraints.
tfl.kronecker_factored_lattice_lib.finalize_weight_constraints(
weights, units, scale, monotonicities, output_min, output_max
)
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.
Returns | |
---|---|
Projected weights tensor of same shape as weights .
|