Restoring partly occluded patterns: a neural network model