Neural networks made of light can make machine learning more sustainable