code: public void pretrain(MultiDataSetIterator iter, int numEpochs) {
          try{
              pretrainHelper(iter, numEpochs);
          } catch (OutOfMemoryError e){
              CrashReportingUtil.writeMemoryCrashDump(this, e);
              throw e;
          }
      }
docs: Pretrain network with multiple inputs and/or outputs<br>
  This method performs layerwise pretraining on all pre-trainable layers in the network (VAEs, Autoencoders, etc), for the specified
  number of epochs each. For example, if numEpochs=3, then layer 0 will be fit for 3 epochs, followed by layer 1
  for 3 epochs, and so on.<br>
  Non-pretrainable layers are ignored
  
  @param iter      Training data
  @param numEpochs Number of epochs to fit each layer with
  @see #pretrainLayer(String, MultiDataSetIterator)