Skip to content

Commit

Permalink
neg sample for u in gcn
Browse files Browse the repository at this point in the history
  • Loading branch information
chihming committed Mar 28, 2019
1 parent 4f1d12c commit 96d2c5d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/proNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2716,9 +2716,11 @@ void proNet::UpdateCBOWdev(vector< vector<double> >& w_vertex, vector< vector<do
label = 0.0;
for (int neg=0; neg!=negative_samples; ++neg)
{
neg_context = NegativeSample();
while(field[neg_context].fields[0]!=2)
neg_context = NegativeSample();
neg_context = SourceSample();
//neg_context = NegativeSample();
while(field[neg_context].fields[0]!=0)
neg_context = SourceSample();
//neg_context = NegativeSample();
Opt_SigmoidRegSGD(w_avg, w_context[neg_context], label, alpha, reg, back_err, w_context[neg_context]);
//Opt_SGD(w_vertex[vertex], w_context[context], label, alpha, reg, back_err, w_context[context]);
}
Expand Down

0 comments on commit 96d2c5d

Please sign in to comment.