I am trying to use the input layer to compute a residue and have the loss function based on that residue. I am trying to use the method described in this answer, however whe