Generalization of a deep learning network for beamforming and segmentation of ultrasound images