Spectral Inference Networks: Unifying Spectral Methods With Deep Learning