'Compute the gradient of loss with respect to coefs and intercept for
specified layer.
This function does backpropagation for the specified one layer.'

def _compute_loss_grad(self, layer, n_samples, activations, deltas, coef_grads, intercept_grads):

    coef_grads[layer] = safe_sparse_dot(activations[layer].T, deltas[layer])
    coef_grads[layer] += (self.alpha * self.coefs_[layer])
    coef_grads[layer] /= n_samples
    intercept_grads[layer] = np.mean(deltas[layer], 0)
    return (coef_grads, intercept_grads)
