The way of creating these weights should be correct and the optimizer should be able to update them, if you pass them properly to it.
However, wouldn’t the optimizer try to force these weights to zeros (or rather negative values), as it would decrease the loss?