public class CifarLoader extends NativeImageLoader implements Serializable
BaseImageLoader.MultiPageMode| Modifier and Type | Field and Description |
|---|---|
static int |
CHANNELS |
static Map<String,String> |
cifarDataMap |
static boolean |
DEFAULT_SHUFFLE |
static boolean |
DEFAULT_USE_SPECIAL_PREPROC |
protected int |
fileNum |
protected File |
fullDir |
static int |
HEIGHT |
protected InputStream |
inputStream |
protected List<String> |
labels |
protected DataSet |
loadDS |
protected int |
loadDSIndex |
protected boolean |
meanStdStored |
protected File |
meanVarPath |
static int |
NUM_LABELS |
static int |
NUM_TEST_IMAGES |
static int |
NUM_TRAIN_IMAGES |
protected int |
numExamples |
protected long |
seed |
protected boolean |
shuffle |
protected String |
testFilesSerialized |
protected InputStream |
testInputStream |
protected boolean |
train |
protected String |
trainFilesSerialized |
protected InputStream |
trainInputStream |
protected double |
uMean |
protected boolean |
useSpecialPreProcessCifar |
protected double |
uStd |
protected double |
vMean |
protected double |
vStd |
static int |
WIDTH |
ALLOWED_FORMATS, convertercenterCropIfNeeded, channels, height, imageTransform, multiPageMode, rng, width| Constructor and Description |
|---|
CifarLoader() |
CifarLoader(boolean train) |
CifarLoader(boolean train,
File fullPath) |
CifarLoader(int height,
int width,
int channels,
boolean train,
boolean useSpecialPreProcessCifar) |
CifarLoader(int height,
int width,
int channels,
ImageTransform imgTransform,
boolean train,
boolean useSpecialPreProcessCifar) |
CifarLoader(int height,
int width,
int channels,
ImageTransform imgTransform,
boolean train,
boolean useSpecialPreProcessCifar,
boolean shuffle) |
CifarLoader(int height,
int width,
int channels,
ImageTransform imgTransform,
boolean train,
boolean useSpecialPreProcessCifar,
File fullDir,
long seed,
boolean shuffle) |
| Modifier and Type | Method and Description |
|---|---|
INDArray |
asMatrix(File f)
As per
BaseImageLoader.asMatrix(File, boolean) but NCHW/channels_first format |
INDArray |
asMatrix(InputStream inputStream) |
INDArray |
asRowVector(File f)
Convert a file to a row vector
|
INDArray |
asRowVector(InputStream inputStream) |
org.bytedeco.opencv.opencv_core.Mat |
convertCifar(org.bytedeco.opencv.opencv_core.Mat orgImage)
Preprocess and store cifar based on successful Torch approach by Sergey Zagoruyko
Reference: https://github.com/szagoruyko/cifar.torch
|
DataSet |
convertDataSet(int num) |
org.nd4j.common.primitives.Pair<INDArray,org.bytedeco.opencv.opencv_core.Mat> |
convertMat(byte[] byteFeature) |
InputStream |
getInputStream() |
List<String> |
getLabels() |
protected void |
load() |
DataSet |
next(int batchSize) |
DataSet |
next(int batchSize,
int exampleNum) |
void |
normalizeCifar(File fileName)
Normalize and store cifar based on successful Torch approach by Sergey Zagoruyko
Reference: https://github.com/szagoruyko/cifar.torch
|
void |
reset() |
void |
setInputStream() |
double |
varManual(INDArray x,
double mean) |
asFrame, asFrame, asImageMatrix, asImageMatrix, asImageMatrix, asImageMatrix, asImageMatrix, asMat, asMat, asMatrix, asMatrix, asMatrix, asMatrix, asMatrix, asMatrix, asMatrix, asMatrix, asMatrixView, asMatrixView, asMatrixView, asMatrixView, asMatrixView, asRowVector, asRowVector, asRowVector, asRowVector, asRowVector, asWritable, asWritable, centerCropIfNeeded, fillNDArray, getAllowedFormats, scalingIfNeed, scalingIfNeed, transformImage, transformImagedownloadAndUntarpublic static final int NUM_TRAIN_IMAGES
public static final int NUM_TEST_IMAGES
public static final int NUM_LABELS
public static final int HEIGHT
public static final int WIDTH
public static final int CHANNELS
public static final boolean DEFAULT_USE_SPECIAL_PREPROC
public static final boolean DEFAULT_SHUFFLE
protected final File fullDir
protected final File meanVarPath
protected final String trainFilesSerialized
protected final String testFilesSerialized
protected InputStream inputStream
protected InputStream trainInputStream
protected InputStream testInputStream
protected boolean train
protected boolean useSpecialPreProcessCifar
protected long seed
protected boolean shuffle
protected int numExamples
protected double uMean
protected double uStd
protected double vMean
protected double vStd
protected boolean meanStdStored
protected int loadDSIndex
protected DataSet loadDS
protected int fileNum
public CifarLoader()
public CifarLoader(boolean train)
public CifarLoader(boolean train,
File fullPath)
public CifarLoader(int height,
int width,
int channels,
boolean train,
boolean useSpecialPreProcessCifar)
public CifarLoader(int height,
int width,
int channels,
ImageTransform imgTransform,
boolean train,
boolean useSpecialPreProcessCifar)
public CifarLoader(int height,
int width,
int channels,
ImageTransform imgTransform,
boolean train,
boolean useSpecialPreProcessCifar,
boolean shuffle)
public CifarLoader(int height,
int width,
int channels,
ImageTransform imgTransform,
boolean train,
boolean useSpecialPreProcessCifar,
File fullDir,
long seed,
boolean shuffle)
public INDArray asRowVector(File f) throws IOException
NativeImageLoaderasRowVector in class NativeImageLoaderf - the image to convertIOExceptionpublic INDArray asRowVector(InputStream inputStream) throws IOException
asRowVector in class NativeImageLoaderIOExceptionpublic INDArray asMatrix(File f) throws IOException
BaseImageLoaderBaseImageLoader.asMatrix(File, boolean) but NCHW/channels_first formatasMatrix in class NativeImageLoaderIOExceptionpublic INDArray asMatrix(InputStream inputStream) throws IOException
asMatrix in class NativeImageLoaderIOExceptionprotected void load()
public org.bytedeco.opencv.opencv_core.Mat convertCifar(org.bytedeco.opencv.opencv_core.Mat orgImage)
public void normalizeCifar(File fileName)
public org.nd4j.common.primitives.Pair<INDArray,org.bytedeco.opencv.opencv_core.Mat> convertMat(byte[] byteFeature)
public DataSet convertDataSet(int num)
public double varManual(INDArray x, double mean)
public DataSet next(int batchSize)
public DataSet next(int batchSize, int exampleNum)
public InputStream getInputStream()
public void setInputStream()
public void reset()
Copyright © 2022. All rights reserved.