Training Arbitrarily Connected Neural Networks With Second Order Algorithms