Hi; I’m interested to learn a function NN(x1,x2) such that derivative of NN(x1,x2) w.r.t. x2 to be positive.
In my code; I have done x1.shape = (N,D) and x2.shape = (N,1) where N is the number of data points.  X = torch.cat([x1,x2],dim=-1) then do  NN(X).
Now, I only want to restrict the derivative of x2 to be positive and this makes sense as x2 is only one dimension while keep ‘x1’ to be free but I don’t want to train two different neural network here.
I’m wondering what’s the proper and safe way of doing this ?