add setTrainData and setCriterion for optimizer reuse (#1986)
add setTrainData and setCriterion for optimizer reuse (#1986)

* add setTrainData and setCriterion for optimizer reuse, both scala and python api
* refactor the apply of Optimizer and setTrainData, changed docs

yangw1234/BigDL,intel-analytics/BigDL,yangw1234/BigDL,intel-analytics/BigDL,intel-analytics/BigDL,yangw1234/BigDL,intel-analytics/BigDL,yangw1234/BigDL