WIP refactoring of backprop_sgd.pyx