Added calcGradient function to the network node

This will allow cascade correlation to calculate the gradient for the
subnetwork.