Translate C# back propagation implementation to java.