Tunable neural networks for multi-material image formation from spectral CT measurements