Switched to online learning instead of batch learning

y[i]*(1-y[i])==0 if y is binary…