net: removed num-labels as param of get-cost-and-gradient