|View source on GitHub
Jointly projects into all supported constraints.
For all combinations of constraints except the case where bounds constraints are specified without monotonicity constraints we properly project into nearest point with respect to L2 norm. For latter case we use a heuristic to map input point into some feasible point with no guarantees on how close this point is to the true projection.
If only bounds or only monotonicity constraints are specified there will be a single step projection. For all other combinations of constraints we use num_projection_iterations iterations of Dykstra's alternating projection algorithm to jointly project onto all the given constraints. Dykstra's algorithm gives us proper projection with respect to L2 norm but approaches it from "wrong" side. That's why in order to ensure that constraints are strictly met we'll do approximate projections in the end which project strictly into feasible space, but it's not an exact projection with respect to the L2 norm. With enough iterations of the Dykstra's algorithm, the impact of such approximate projection should be negligible.
With bound and convexity constraints and no specified monotonicity, this method does not fully satisfy the constrains. Increasing the number of iterations can reduce the constraint violation in such cases.
(num_keypoints, units)-shape tensor which represents weights of
PWL calibration layer.
|1 for increasing, -1 for decreasing, 0 for no monotonicity constraints.
|Lower bound constraint of PWL calibration layer.
|Upper bound constraint of PWL calibration layer.
describing the constraints on the layer's minimum value.
describing the constraints on the layer's maximum value.
|1 for convex, -1 for concave, 0 for no convexity constraints.
|Lengths of pieces of piecewise linear function. Needed only if convexity projection is specified.
|Number of iterations of Dykstra's alternating projection algorithm.
|Projected weights tensor.