I want use glow to train NN on a new chip. I wanna ask a few question about Training. Thanks for helping!

In the example/mnist.cpp, I found the code use same data to train and infer, is that right?
How do I specify a loss function before training? How do I know how many steps I should train before success?
I can load a modle from caffee2 or onnx and use it to infer, But if I want to load a net from caffee2 or onnx and use it to train, what should I do? Should I modify the code of " image-iclassifier" to support train mode?

Thank you very much for your help!