File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
algo/src/main/java/org/neo4j/gds/embeddings/node2vec Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,8 @@ Node2VecResult train() {
128
128
129
129
var lossPerIteration = new ArrayList <Double >();
130
130
131
+ AtomicInteger taskIndex = new AtomicInteger (0 );
132
+
131
133
for (int iteration = 0 ; iteration < iterations ; iteration ++) {
132
134
progressTracker .beginSubTask ();
133
135
progressTracker .setVolume (walks .size ());
@@ -137,7 +139,7 @@ Node2VecResult train() {
137
139
initialLearningRate - iteration * learningRateAlpha
138
140
);
139
141
140
- var tasks = createTrainingTasks (learningRate );
142
+ var tasks = createTrainingTasks (learningRate , taskIndex );
141
143
142
144
RunWithConcurrency .builder ()
143
145
.concurrency (concurrency )
@@ -288,8 +290,7 @@ void addAll(FloatConsumer other) {
288
290
}
289
291
}
290
292
291
- List <TrainingTask > createTrainingTasks (float learningRate ){
292
- AtomicInteger taskIndex = new AtomicInteger (0 );
293
+ List <TrainingTask > createTrainingTasks (float learningRate , AtomicInteger taskIndex ){
293
294
return PartitionUtils .degreePartitionWithBatchSize (
294
295
walks .size (),
295
296
walks ::walkLength ,
You can’t perform that action at this time.
0 commit comments