code: public void sampleSequenceBackward(SequenceModel model, int[] sequence, double temperature) {
      for (int pos=sequence.length-1; pos>=0; pos--) {
        samplePosition(model, sequence, pos, temperature);
      }
    }
docs: Samples the complete sequence once in the backward direction
  Destructively modifies the sequence in place.
  @param sequence the sequence to start with.