diff --git a/toolkits/collaborative_filtering/als.cpp b/toolkits/collaborative_filtering/als.cpp index ff9de205..5c791ffd 100644 --- a/toolkits/collaborative_filtering/als.cpp +++ b/toolkits/collaborative_filtering/als.cpp @@ -131,7 +131,7 @@ struct ALSVerticesInMemProgram : public GraphChiProgramget_data(); vertex_data & nbr_latent = latent_factors_inmem[vertex.edge(e)->vertex_id()]; Xty += nbr_latent.pvec * observation; - XtX.triangularView() += nbr_latent.pvec * nbr_latent.pvec.transpose(); + XtX.selfadjointView().rankUpdate(nbr_latent.pvec); if (compute_rmse) { double prediction; rmse_vec[omp_get_thread_num()] += als_predict(vdata, nbr_latent, observation, prediction); diff --git a/toolkits/collaborative_filtering/libfm.cpp b/toolkits/collaborative_filtering/libfm.cpp index 0aaa5408..f3757827 100644 --- a/toolkits/collaborative_filtering/libfm.cpp +++ b/toolkits/collaborative_filtering/libfm.cpp @@ -314,7 +314,7 @@ int main(int argc, const char ** argv) { vec user_bias = load_matrix_market_vector(training +"_U_bias.mm", false, true); vec item_bias = load_matrix_market_vector(training +"_V_bias.mm", false, true); vec time_bias = load_matrix_market_vector(training+ "_T_bias.mm", false, true); - vec last_item_bias = load_matrix_market_vector(training+"_L_bias.m", false, true); + vec last_item_bias = load_matrix_market_vector(training+"_L_bias.mm", false, true); for (uint i=0; iget_data(); vertex_data & nbr_latent = latent_factors_inmem[vertex.edge(e)->vertex_id()]; Xty += nbr_latent.pvec * edge.weight * edge.time; - XtX.triangularView() += nbr_latent.pvec * nbr_latent.pvec.transpose() * edge.time; + XtX.selfadjointView().rankUpdate(nbr_latent.pvec, edge.time); if (compute_rmse) { double prediction; rmse_vec[omp_get_thread_num()] += wals_predict(vdata, nbr_latent, edge.weight, prediction) * edge.time;