Adding gradient functions for softmax and predictNode