Adds a positive constraint on the weights of a Linear layer.
If the Linear layer has intercepts, the constraint won't apply to them.
This is implemented as a proximal operator during SGD.
1 // force weights to be positive:
2 auto l1 = Linear(5).prior(PositivePrior());
4 // force weights to be above 1e-3:
5 auto l2 = Linear(10).prior(PositivePrior(1e-3));