Machine learning applied to monochromatic diffraction: direct and inverse problems | Synapse