MCPcopy Create free account
hub / github.com/dmlc/parameter_server / preprocessData

Method preprocessData

src/learner/bcd.h:226–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 12

fea_grp_sizeMethod · 0.80
fea_grpMethod · 0.80
hit_cacheMethod · 0.80
waitInMsgMethod · 0.80
clearTailFilterMethod · 0.80
keyMethod · 0.80
clearMethod · 0.45
finishMethod · 0.45
resizeMethod · 0.45
valueMethod · 0.45
sizeMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected