public synchronized void fit(MultiDataSetIterator multi) {
        if (flattenedGradients == null) {
            initGradientsView();
        }

        if(!multi.hasNext() && multi.resetSupported()){
            multi.reset();
        }

        for (TrainingListener tl : trainingListeners) {
            tl.onEpochStart(this);
        }

        boolean destructable = false;

        MultiDataSetIterator multiDataSetIterator;
        if (multi.asyncSupported()) {
            multiDataSetIterator = new AsyncMultiDataSetIterator(multi, Math.max(Nd4j.getAffinityManager().getNumberOfDevices() * 2, 2), true);
            destructable = true;
        } else
            multiDataSetIterator = multi;

        long time1 = System.currentTimeMillis();
        while(multiDataSetIterator.hasNext()){
            MultiDataSet mds = multiDataSetIterator.next();
            long time2 = System.currentTimeMillis();
            lastEtlTime.set((time2 - time1));

            fit(mds.getFeatures(),mds.getLabels(), mds.getFeaturesMaskArrays(), mds.getLabelsMaskArrays());
            time1 = System.currentTimeMillis();
        }

        if (destructable)
            ((AsyncMultiDataSetIterator) multiDataSetIterator).shutdown();

        for (TrainingListener tl : trainingListeners) {
            tl.onEpochEnd(this);
        }

        incrementEpochCount();
    }
public synchronized void fit ( MultiDataSetIterator multi ) { if ( flattenedGradients == null ) { initGradientsView ( ) ; } if ( ! multi . hasNext ( ) && multi . resetSupported ( ) ) { multi . reset ( ) ; } for ( TrainingListener tl : trainingListeners ) { tl . onEpochStart ( this ) ; } boolean destructable = false ; MultiDataSetIterator multiDataSetIterator ; if ( multi . asyncSupported ( ) ) { multiDataSetIterator = new AsyncMultiDataSetIterator ( multi , Math . max ( Nd4j . getAffinityManager ( ) . getNumberOfDevices ( ) * 2 , 2 ) , true ) ; destructable = true ; } else multiDataSetIterator = multi ; long time1 = System . currentTimeMillis ( ) ; while ( multiDataSetIterator . hasNext ( ) ) { MultiDataSet mds = multiDataSetIterator . next ( ) ; long time2 = System . currentTimeMillis ( ) ; lastEtlTime . set ( ( time2 - time1 ) ) ; fit ( mds . getFeatures ( ) , mds . getLabels ( ) , mds . getFeaturesMaskArrays ( ) , mds . getLabelsMaskArrays ( ) ) ; time1 = System . currentTimeMillis ( ) ; } if ( destructable ) ( ( AsyncMultiDataSetIterator ) multiDataSetIterator ) . shutdown ( ) ; for ( TrainingListener tl : trainingListeners ) { tl . onEpochEnd ( this ) ; } incrementEpochCount ( ) ; }
Fit the ComputationGraph using a MultiDataSetIterator
Method doesn't do layerwise  pretraining.<br>
For pretraining use method pretrain.. {@link #pretrain(MultiDataSetIterator)}<br>
@param multi Training data (MultiDataSetIterator)