I am trying to optimize a function with gradient descent and I have a constraint that the values should be between zero and one. Is clamping the updated values the only way to deal with this kind of problems? is it a common approach for dealing with this constraint in machine learning community? another approach that I tried was to use logarithm of the weights as the variables for optimization, but it just solves the problem of positivity.
It might not be the best place to ask this question but I found this post very related.