本文整理汇总了Java中org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor类的典型用法代码示例。如果您正苦于以下问题:Java MultiDataSetPreProcessor类的具体用法?Java MultiDataSetPreProcessor怎么用?Java MultiDataSetPreProcessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MultiDataSetPreProcessor类属于org.nd4j.linalg.dataset.api包,在下文中一共展示了MultiDataSetPreProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPreProcessor
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
@Override
public void setPreProcessor(MultiDataSetPreProcessor preProcessor) { throw new UnsupportedOperationException("Not Implemented"); }
示例2: setPreProcessor
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
@Override
public void setPreProcessor(MultiDataSetPreProcessor preProcessor) {
this.preProcessor = preProcessor;
}
示例3: getPreProcessor
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
@Override
public MultiDataSetPreProcessor getPreProcessor() {
return this.preProcessor;
}
示例4: getTrainIterator
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
/**
* This method returns train iterator instance
*
* @return
*/
public MultiDataSetIterator getTrainIterator() {
return new MultiDataSetIterator() {
@Override
public MultiDataSet next(int num) {
throw new UnsupportedOperationException("To be implemented yet");
}
@Override
public void setPreProcessor(MultiDataSetPreProcessor preProcessor) {
backedIterator.setPreProcessor(preProcessor);
}
@Override
public MultiDataSetPreProcessor getPreProcessor() {
return backedIterator.getPreProcessor();
}
@Override
public boolean resetSupported() {
return backedIterator.resetSupported();
}
@Override
public boolean asyncSupported() {
return backedIterator.asyncSupported();
}
@Override
public void reset() {
resetPending.set(true);
}
@Override
public boolean hasNext() {
if (resetPending.get()) {
if (resetSupported()) {
backedIterator.reset();
counter.set(0);
resetPending.set(false);
} else
throw new UnsupportedOperationException("Reset isn't supported by underlying iterator");
}
val state = backedIterator.hasNext();
if (state && counter.get() < numTrain)
return true;
else
return false;
}
@Override
public MultiDataSet next() {
counter.incrementAndGet();
val p = backedIterator.next();
if (counter.get() == 1 && firstTrain == null) {
// first epoch ever, we'll save first dataset and will use it to check for equality later
firstTrain = (org.nd4j.linalg.dataset.MultiDataSet) p.copy();
firstTrain.detach();
} else if (counter.get() == 1) {
// epoch > 1, comparing first dataset to previously stored dataset. they should be equal
int cnt = 0;
for (val c: p.getFeatures())
if (!c.equalsWithEps(firstTrain.getFeatures()[cnt++], 1e-5))
throw new ND4JIllegalStateException("First examples do not match. Randomization was used?");
}
return p;
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
}
示例5: getTestIterator
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
/**
* This method returns test iterator instance
*
* @return
*/
public MultiDataSetIterator getTestIterator() {
return new MultiDataSetIterator() {
@Override
public MultiDataSet next(int num) {
throw new UnsupportedOperationException("To be implemented yet");
}
@Override
public void setPreProcessor(MultiDataSetPreProcessor preProcessor) {
backedIterator.setPreProcessor(preProcessor);
}
@Override
public MultiDataSetPreProcessor getPreProcessor() {
return backedIterator.getPreProcessor();
}
@Override
public boolean resetSupported() {
return backedIterator.resetSupported();
}
@Override
public boolean asyncSupported() {
return backedIterator.asyncSupported();
}
@Override
public void reset() {
resetPending.set(true);
}
@Override
public boolean hasNext() {
val state = backedIterator.hasNext();
if (state && counter.get() < numTrain + numTest)
return true;
else
return false;
}
@Override
public MultiDataSet next() {
return backedIterator.next();
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
}
示例6: getPreProcessor
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
@Override
public MultiDataSetPreProcessor getPreProcessor() {
return backedIterator.getPreProcessor();
}
示例7: getPreProcessor
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
@Override
public MultiDataSetPreProcessor getPreProcessor() {
return preProcessor;
}
示例8: setPreProcessor
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
@Override
public void setPreProcessor(MultiDataSetPreProcessor preProcessor) {
underlyingIterator.setPreProcessor(preProcessor);
}
示例9: getPreProcessor
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
@Override
public MultiDataSetPreProcessor getPreProcessor() {
return underlyingIterator.getPreProcessor();
}
示例10: getPreProcessor
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
@Override
public MultiDataSetPreProcessor getPreProcessor() {
return backingIterator.getPreProcessor();
}
示例11: setPreProcessor
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
@Override
public void setPreProcessor(MultiDataSetPreProcessor multiDataSetPreProcessor) {
this.preProcessor = multiDataSetPreProcessor;
}
示例12: getPreProcessor
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
@Override
public MultiDataSetPreProcessor getPreProcessor() {
return null;
}
示例13: preProcess
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
@Override
public void preProcess(MultiDataSet multiDataSet) {
for (MultiDataSetPreProcessor preProcessor : preProcessors) {
preProcessor.preProcess(multiDataSet);
}
}
示例14: addPreProcessor
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
/**
* @param preProcessor to be added to list of preprocessors to be applied
*/
public Builder addPreProcessor(@NonNull MultiDataSetPreProcessor preProcessor) {
preProcessors.add(preProcessor);
return this;
}
示例15: setPreProcessor
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor; //导入依赖的package包/类
@Override
public void setPreProcessor(MultiDataSetPreProcessor preProcessor) {
// no-op
}