Noise and randomlike behaviour of perceptrons: theory and applications to protein structure prediction