How to access and control the parts of a partial derivative?

Hi, I want to access and control the parts of a partial derivative. For the below figure, x is input data, l_{1, 2, 3} are layers with learnable parameters, alpha is a learnable parameter, and the last is a loss function.

image

The partial derivative of the loss function with respect to the alpha can be represented as follows:

image

Is it possible to access each term in right hand side to modify its value? Right now, I do not have any idea to do that using .backward().

Thanks.

I solved it by adding additional learnable parameters between alpha and each layer.