Phase Transitions in Neural Networks