I want to use Border22 with the values just higher than 0, i tried x[x>value] or x[:,x>value], but does not work. I need to have values just higher than zero and then pass it to the backward.()
this ( Border22[Border22>0]) give me again 0 value too.
I change my cod ein different ways to solve the error. The current code is as follow, but it gave me zero gradients. Would you please help me with that? L1 is 0.8
Your current code snippet uses undefined methods, so I cannot debug it.
As usual, could you post an executable code snippet, which would reproduce this issue?
I solved the problem of this code. Now I have another , never finish. I need to do binary thresholding for x>value =1 and x<value=0, but in the way that after thresholding I can pass it to the backward.().
For example for the above code zzz and zzz1 be the binary maps and use in L1 loss. How define zzz and zzz1?
Based on your description it seems you want to use a step function, which would have a zero gradient everywhere (except exactly as x==value), so it won’t be useful for your loss and gradient calculation.
If this would work, you could directly optimize the model predictions without e.g. using sigmoid or softmax.