Skip to content

Commit

Permalink
dev for ui+iw_c
Browse files Browse the repository at this point in the history
  • Loading branch information
chihming committed Apr 20, 2019
1 parent b9056f9 commit b57332e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/proNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2722,7 +2722,7 @@ void proNet::UpdateCBOWdev(vector< vector<double> >& w_vertex, vector< vector<do
Opt_SigmoidRegSGD(w_vertex[event], w_avg, label, alpha, reg, w_vertex[event], back_err);
// positive (event, user)
event = TargetSample(user);
Opt_SigmoidRegSGD(w_context[event], w_vertex[user], label, alpha, reg, w_context[event], user_err);
Opt_SigmoidRegSGD(w_vertex[event], w_vertex[user], label, alpha, reg, w_vertex[event], user_err);

// negative event sampling
label = 0.0;
Expand All @@ -2738,7 +2738,7 @@ void proNet::UpdateCBOWdev(vector< vector<double> >& w_vertex, vector< vector<do
neg_event = random_gen(0, MAX_vid);
while(field[neg_event].fields[0]!=1)
neg_event = random_gen(0, MAX_vid);
Opt_SigmoidRegSGD(w_context[neg_event], w_vertex[user], label, alpha, reg, w_context[neg_event], user_err);
Opt_SigmoidRegSGD(w_vertex[neg_event], w_vertex[user], label, alpha, reg, w_vertex[neg_event], user_err);
}
}
// batch update
Expand All @@ -2749,6 +2749,7 @@ void proNet::UpdateCBOWdev(vector< vector<double> >& w_vertex, vector< vector<do

// 2nd for user-based, word-based
// positive (user, word)
/*
label = 1.0;
Opt_SigmoidRegSGD(w_vertex[user], w_avg, label, alpha, reg, w_vertex[user], back_err);
Expand All @@ -2768,6 +2769,7 @@ void proNet::UpdateCBOWdev(vector< vector<double> >& w_vertex, vector< vector<do
// neg_word = random_gen(0, MAX_vid);
//Opt_SigmoidRegSGD(w_vertex[user], w_context[neg_word], label, alpha, reg, user_err, w_context[neg_word]);
}
*/

for (auto v: bags)
{
Expand Down

0 comments on commit b57332e

Please sign in to comment.