Silicon Photonics Neural Networks for Training and Inference