code: public Factor addBinaryFactor(int a, int b, BiFunction<Integer, Integer, ConcatVector> featurizer) {
      int[] variableDims = getVariableSizes();
      assert a < variableDims.length;
      assert b < variableDims.length;
      return addFactor(new int[]{a, b}, new int[]{variableDims[a], variableDims[b]}, assignment -> featurizer.apply(assignment[0], assignment[1]) );
    }
docs: A simple helper function for defining a binary factor. That is, a factor between two variables in the graphical model.
  
  @param a The index of the first variable.
  @param b The index of the second variable
  @param featurizer The featurizer. This takes as input two assignments for the two variables, and returns the features on
  those variables.
  @return a reference to the created factor. This can be safely ignored, as the factor is already saved in the model