Translation of functions: Layer.java and BackPropagation.java