Inversion of seismic waveforms using neural networks