Electromagnetic reconstruction of layered geometries by a neural network and multi-offset data