Refactor

fix im2bin and logloss issue.