| 224 | virtual void evaluate(BCDProgress* prog) = 0; |
| 225 | |
| 226 | virtual void preprocessData(int time, const BCDCall& call) { |
| 227 | int grp_size = call.fea_grp_size(); |
| 228 | fea_grp_.clear(); |
| 229 | for (int i = 0; i < grp_size; ++i) { |
| 230 | fea_grp_.push_back(call.fea_grp(i)); |
| 231 | } |
| 232 | bool hit_cache = call.hit_cache(); |
| 233 | // filter tail keys |
| 234 | for (int i = 0; i < grp_size; ++i, time += time_ratio_) { |
| 235 | if (hit_cache) continue; |
| 236 | model_.waitInMsg(kWorkerGroup, time); |
| 237 | model_.finish(kWorkerGroup, time+1); |
| 238 | } |
| 239 | for (int i = 0; i < grp_size; ++i, time += time_ratio_) { |
| 240 | // wait untill received all keys from workers |
| 241 | model_.waitInMsg(kWorkerGroup, time); |
| 242 | // initialize the weight |
| 243 | int chl = fea_grp_[i]; |
| 244 | model_.clearTailFilter(chl); |
| 245 | model_.value(chl).resize(model_.key(chl).size()); |
| 246 | model_.value(chl).setValue(bcd_conf_.init_w()); |
| 247 | model_.finish(kWorkerGroup, time+1); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | void saveModel(const DataConfig& output) { |
| 252 |
nothing calls this directly
no test coverage detected