Hey thanks for the reply,
sorry the naming was confusing. I want gradient updates on:

The parameters behind the mask sampling process (to better sample the appropriate mask)
the weights of the underlying model (here named simply model with its weights weights), that are masked by mask.

I will edit the confusing double parameters naming part from the code quickly.
Does this clear it up?