In my studies of applied mathematics, specifically optimization and applied linear algebra, I have come across the following expression which I need help differentiating:
$ z(B,C) = \lVert Y-B \phi(CX) \rVert_F ^2 = \text{trace} \left( (Y-B \phi(CX))(Y-B \phi(CX))^T \right) $
where $ Y \in \mathbb{R}^{m\times s},X\in \mathbb{R}^{n\times s} $ are two constant real matrices, $ B \in \mathbb{R} ^{m\times k} $ and $ C\in\mathbb{R}^{k \times n} $ are the two variable matrices of the function $ z(B,C) $ defined above, $ \lVert \bullet \rVert_F $ is the Frobenius norm and all matrix dimensions involved are constant and non-variable.
The function $ \phi : \mathbb{R} \to \mathbb{R} $ is a nonlinear function defined for real numbers as follows:
$ \phi(x) = \left\{ \begin{array}{ll} 0 & x \leq 0 \\ x & x > 0 \\ \end{array} \right. $
and we extend its definition to matrices element-wise, that is $ (\phi(A))_{i,j} = \phi((A)_{i,j}) $.
I would like to find the matrix derivative of the function $ z $, as stated above, with respect to $ C $, that is $ \frac{\partial z}{\partial C}$.
Differentiating with respect to $ B $ is easy enough as $ C $ doesn't impede applying standard formulas, but my problem is with differentiating with respect to $ C $ as it is the argument of a nonlinear function and I do not know how to derive it with respect to matrices.
I was hoping someone could please come to the rescue and help me differentiate the function $ z $ with respect to $ C $. I thank all helpers.