public class CifarLoader extends NativeImageLoader implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
BYTEFILELEN |
protected static int |
channels |
static int |
CHANNELS |
static Map<String,String> |
cifarDataMap |
static String |
dataBinFile |
static String |
dataBinUrl |
protected int |
fileNum |
static File |
fullDir |
protected static int |
height |
static int |
HEIGHT |
protected static List<org.nd4j.linalg.dataset.DataSet> |
inputBatched |
protected static InputStream |
inputStream |
protected static String |
labelFileName |
protected static List<String> |
labels |
protected org.nd4j.linalg.dataset.DataSet |
loadDS |
protected int |
loadDSIndex |
static String |
localDir |
protected boolean |
meanStdStored |
static File |
meanVarPath |
static int |
NUM_LABELS |
static int |
NUM_TEST_IMAGES |
static int |
NUM_TRAIN_IMAGES |
protected int |
numExamples |
protected static int |
numToConvertDS |
protected static long |
seed |
protected static boolean |
shuffle |
static String |
TESTFILENAME |
protected static String |
testFilesSerialized |
protected static InputStream |
testInputStream |
protected static boolean |
train |
static String[] |
TRAINFILENAMES |
protected static String |
trainFilesSerialized |
protected static InputStream |
trainInputStream |
protected double |
uMean |
static boolean |
useSpecialPreProcessCifar |
protected double |
uStd |
protected double |
vMean |
protected double |
vStd |
protected static int |
width |
static int |
WIDTH |
ALLOWED_FORMATSBASE_DIR, centerCropIfNeeded, imageTransform, log, rng| 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 fullPath,
long seed,
boolean shuffle) |
| Modifier and Type | Method and Description |
|---|---|
org.nd4j.linalg.api.ndarray.INDArray |
asMatrix(File f) |
org.nd4j.linalg.api.ndarray.INDArray |
asMatrix(InputStream inputStream) |
org.nd4j.linalg.api.ndarray.INDArray |
asRowVector(File f)
Convert a file to a row vector
|
org.nd4j.linalg.api.ndarray.INDArray |
asRowVector(InputStream inputStream) |
boolean |
cifarRawFilesExist() |
org.bytedeco.javacpp.opencv_core.Mat |
convertCifar(org.bytedeco.javacpp.opencv_core.Mat orgImage)
Preprocess and store cifar based on successful Torch approach by Sergey Zagoruyko
Reference: https://github.com/szagoruyko/cifar.torch
|
org.nd4j.linalg.dataset.DataSet |
convertDataSet(int num) |
org.datavec.api.berkeley.Pair<org.nd4j.linalg.api.ndarray.INDArray,org.bytedeco.javacpp.opencv_core.Mat> |
convertMat(byte[] byteFeature) |
void |
generateMaps() |
InputStream |
getInputStream() |
List<String> |
getLabels() |
void |
load() |
org.nd4j.linalg.dataset.DataSet |
next(int batchSize) |
org.nd4j.linalg.dataset.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() |
void |
test() |
void |
train() |
double |
varManual(org.nd4j.linalg.api.ndarray.INDArray x,
double mean) |
asMatrix, asMatrix, asRowVector, asRowVector, centerCropIfNeeded, getAllowedFormats, scalingIfNeed, scalingIfNeeddownloadAndUntarpublic 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 int BYTEFILELEN
public static String dataBinUrl
public static String localDir
public static String dataBinFile
public static File fullDir
public static File meanVarPath
protected static String labelFileName
protected static InputStream inputStream
protected static InputStream trainInputStream
protected static InputStream testInputStream
protected static List<org.nd4j.linalg.dataset.DataSet> inputBatched
public static String[] TRAINFILENAMES
public static String TESTFILENAME
protected static String trainFilesSerialized
protected static String testFilesSerialized
protected static boolean train
public static boolean useSpecialPreProcessCifar
protected static int height
protected static int width
protected static int channels
protected static long seed
protected static boolean shuffle
protected int numExamples
protected static int numToConvertDS
protected double uMean
protected double uStd
protected double vMean
protected double vStd
protected boolean meanStdStored
protected int loadDSIndex
protected org.nd4j.linalg.dataset.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 fullPath,
long seed,
boolean shuffle)
public org.nd4j.linalg.api.ndarray.INDArray asRowVector(File f) throws IOException
NativeImageLoaderasRowVector in class NativeImageLoaderf - the image to convertIOExceptionpublic org.nd4j.linalg.api.ndarray.INDArray asRowVector(InputStream inputStream) throws IOException
asRowVector in class NativeImageLoaderIOExceptionpublic org.nd4j.linalg.api.ndarray.INDArray asMatrix(File f) throws IOException
asMatrix in class NativeImageLoaderIOExceptionpublic org.nd4j.linalg.api.ndarray.INDArray asMatrix(InputStream inputStream) throws IOException
asMatrix in class NativeImageLoaderIOExceptionpublic void generateMaps()
public void load()
public boolean cifarRawFilesExist()
public org.bytedeco.javacpp.opencv_core.Mat convertCifar(org.bytedeco.javacpp.opencv_core.Mat orgImage)
public void normalizeCifar(File fileName)
public org.datavec.api.berkeley.Pair<org.nd4j.linalg.api.ndarray.INDArray,org.bytedeco.javacpp.opencv_core.Mat> convertMat(byte[] byteFeature)
public org.nd4j.linalg.dataset.DataSet convertDataSet(int num)
public double varManual(org.nd4j.linalg.api.ndarray.INDArray x,
double mean)
public org.nd4j.linalg.dataset.DataSet next(int batchSize)
public org.nd4j.linalg.dataset.DataSet next(int batchSize,
int exampleNum)
public InputStream getInputStream()
public void setInputStream()
public void reset()
public void train()
public void test()
Copyright © 2016. All rights reserved.