private void ResetGradient()
{
Parallel.For(0, weightsDerivatives.Length, i =>
{
for (int j = 0; j < weightsDerivatives[i].Length; j++)
Array.Clear(weightsDerivatives[i][j], 0, weightsDerivatives[i][j].Length);
Array.Clear(thresholdsDerivatives[i], 0, thresholdsDerivatives[i].Length);
});
}