Spectral kernel machines with electrically tunable photodetectors Science