code: public Factor addBinaryFactor(int a, int cardA, int b, int cardB, BiFunction<Integer, Integer, ConcatVector> featurizer) {
      return addFactor(new int[]{a, b}, new int[]{cardA, cardB}, assignment -> featurizer.apply(assignment[0], assignment[1]) );
    }
docs: Add a binary factor, with known dimensions for the variables
  @param a The index of the first variable.
  @param cardA The cardinality (i.e, dimension) of the first factor
  @param b The index of the second variable
  @param cardB The cardinality (i.e, dimension) of the second factor
  @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