The reason I need a custom autograd function for LinearDecomp is that I only want to forcefully autograd train coefs and bias but not dictionary. So, I need to fix the dictionary requires_grad=False. (As you might notice in the class Decomp_Net(nn.Module)) -> def init
I have
self.B_conv1 = nn.Parameter(params.items()[1][1], requires_grad=True).cuda()
self.D_conv1 = nn.Parameter(self.D_conv1, requires_grad=False).cuda()
self.X_a_conv1 = nn.Parameter(self.X_a_conv1, requires_grad=True).cuda()