System Identification with General Dynamic Networks and Network Pruning