Hi,
I am currently working on a code in which I need a matrix (I am currently using nn.Parameter) to be trainable. However I need the said matrix to have entries as either 0 or 1. How can I impose a constraint for the weight updates to happen in such a way that 0 is flipped to 1 or the other way around, based on if the back propagation requires the weight to be increased or decreased? It is alright if the solution uses something other than nn.Parameter.
PS: I have tried nn.Linear layers, nn.Conv1d layers as well. I can’t get the matrix/kernel to only have zeros and ones.
Any help is appreciated.