Transition to Linearity of General Neural Networks with Directed Acyclic Graph Architecture