You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you can use GetUpdater()->Save(bool save_aux, dmlc::Stream *fo) in such as sgd_learner.cc
and Save(bool save_aux, dmlc::Stream *fo) should be implemented first
eg: (just a draft)
void SGDUpdater::Save(bool save_aux, dmlc::Stream *fo) const {
int saved = 0;
for (const auto& it : model_) {
if (it.second.Empty()) continue;
int n = param_.V_dim;
fo->Write(&it.first, sizeof(feaid_t));
fo->Write(it.second.w, sizeof(real_t));
if (it.second.V) {
for (int i = 0; i < n; i) {
fo->Write(it.second.V[i], sizeof(real_t));
}
}
if (save_aux) {
fo->Write(&(it.second.z), sizeof(real_t));
fo->Write(&(it.second.sqrt_g), sizeof(real_t));
}
saved ;
}
LOG(INFO) << "saved " << saved << " kv pairs";
}
is it possible to save the learnt vector and matrix somehow?
The text was updated successfully, but these errors were encountered: