Quantum optical neural networks for computation