net: refactored theta-gradient. started writing fmincg line-search function