I'm asked to differentiate the following hinge loss term. $$ \dfrac{1}{n}\sum _{\left( x_{i},y_{1}\right) \in S}\sum _{j'=1}L\left( w^{j'};\left( x_{i},y_{i}\right) \right) $$
where $$ L\left( w^{j'};\left( x_{i},y_{i}\right) \right) = ( \max \{ 0,2-\left( \langle w^{j'},x_{i}\rangle \right) 1\{ y_{i}= j'\} ) ^{2} $$
The one function is = 1 when $y_i = j'$ and 0 otherwise. I need the partial derivative along $w^j_k$. I also have the following assumption to help me : $$\dfrac{\partial }{\partial a}\max \left\{ 0,a\right\} =\begin{cases} 1 \quad \text{if} \quad a >0\\ 0 \quad \text{if} \quad a\leq 0\end{cases}$$ I know that this assumption not really true but just consider it as true in my case.
My problem is that I have no clue how to differentiate this and I need this to compute the gradient for my SVM model.