Neural networks to study invariant features of protein folding