Cost function NN with weight derivation In a single layered neural network with a sigmoid function (to make it easy to understand)
the cost function is
$E_j = \frac{1}{2} \sum_{k=1}^{K}(\text{target}_{jk} - \text{observed}_{jk})^2  + a\sum_{i=1}^{I}w_{ij}^2.$
So this is a two part problem and I know how to derive the first half at both the hidden and output layers. But, for the second half, I am not sure. 
Any advice or help would be great. Thank you.
 A: It's the same formula but with different notations, if there is something that you don't understand, tell me
$J(\Theta ) = \frac{1}{2m}[\sum_{i=1}^{m} ( h_{\Theta }(x^{(i)}) - y^{(i)})^{2} + \lambda \sum_{j=1}^{n}\Theta_{j}^{2}]$
The derivative w.r.t $\Theta$
$\frac{\partial }{\partial \Theta_{j}} = \frac{1}{m}[\sum_{i=1}^{m} ( h_{\Theta }(x^{(i)}) - y^{(i)}))x_{j}^{(i)} + \lambda \Theta_{j}]$
This will give you the update for the weight $j$, that you use with gradient descent: $\Theta_{j} \leftarrow  \Theta_{j} - \eta \frac{\partial }{\partial \Theta_{j}}$
And you do that for all your weights from $j = (1, 2, ..., n)$
A: The regularization parameter is a form of Tikhonov's regulraization term (which is derived from the point of view of adding a preference to the particular solution when looking for the minimum of residuals)- as there are many ways of regularizing the neural network error function. You are simply trying to reduce the risk of overfitting by "punishing" your network for having big weights values. This 
$$ a\sum_{i,j} w_{ij}^2 $$
term is simply a weighted square of the weights norm 
$$ a \left \| w \right \|^2 = \left \| (\sqrt{a}I) w \right \|^2 $$
where $a$ is a constant used for balancing the networks fitting to the data ("left half") and its complexity ("right half"). The notion of network complexity is a complex issue on itself, this is why there have been many ideas for a regularization terms. In general, most of the currently used are methods of Tikhonov's regularization, but these are not the only ones. 
