code: @Override
      public synchronized double learnSequence(@NonNull Sequence<T> sequence, @NonNull AtomicLong nextRandom,
                      double learningRate) {
          /*
                  GloVe learning algorithm is implemented like a hack over settled ElementsLearningAlgorithm mechanics. It's called in SequenceVectors context, but actually only for the first call.
                  All subsequent calls will met early termination condition, and will be successfully ignored. But since elements vectors will be updated within first call,
                  this will allow compatibility with everything beyond this implementaton
           */
          if (isTerminate.get())
              return 0;
  
          final AtomicLong pairsCount = new AtomicLong(0);
          final Counter<Integer> errorCounter = new Counter<>();
  
          //List<Pair<T, T>> coList = coOccurrences.coOccurrenceList();
  
          for (int i = 0; i < configuration.getEpochs(); i++) {
  
              // TODO: shuffle should be built in another way.
              //if (shuffle)
              //Collections.shuffle(coList);
  
              Iterator<Pair<Pair<T, T>, Double>> pairs = coOccurrences.iterator();
  
              List<GloveCalculationsThread> threads = new ArrayList<>();
              for (int x = 0; x < workers; x++) {
                  threads.add(x, new GloveCalculationsThread(i, x, pairs, pairsCount, errorCounter));
                  threads.get(x).start();
              }
  
  
  
              for (int x = 0; x < workers; x++) {
                  try {
                      threads.get(x).join();
                  } catch (Exception e) {
                      throw new RuntimeException(e);
                  }
              }
  
              log.info("Processed [" + pairsCount.get() + "] pairs, Error was [" + errorCounter.getCount(i) + "]");
          }
  
          isTerminate.set(true);
          return 0;
      }
docs: Learns sequence using GloVe algorithm
  
  @param sequence
  @param nextRandom
  @param learningRate