philsupertramp/game-math
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ImageDataSet Class Reference

only include Magick++ if needed More...

#include <ImageDataSet.h>

Inheritance diagram for ImageDataSet:
DataSet

Public Member Functions

 ImageDataSet (size_t inputCount, size_t outputCount)
 
virtual void PrepareDirectory (const char *filePath)
 
void Cache ()
 
- Public Member Functions inherited from DataSet
 DataSet (const char *filePath, size_t inputCount, size_t outputCount)
 
 DataSet (size_t inputCount, size_t outputCount)
 
virtual void PrepareDirectory (const char *filePath)
 

Public Attributes

size_t imageHeight = 180
 desired image height More...
 
size_t imageWidth = 180
 desired image width More...
 
double validationShare = 0.2
 percentage of validation data More...
 
const char * trainDirectory = "../../resources/image_classification/training/"
 target directory for training More...
 
std::vector< MatrixDS< bool > > classes
 representation of all classes More...
 
std::vector< std::string > classNames
 representation of all class names More...
 
size_t totalCount = 0
 total number of data records More...
 
size_t trainingCount = 0
 number of training data records More...
 
size_t validationCount = 0
 number of validation data records More...
 
- Public Attributes inherited from DataSet
size_t InputCount
 number input elements More...
 
size_t OutputCount
 number output elements More...
 
Set Training
 set for training More...
 
Set Validation
 set for validation of training More...
 
Set Test
 set to test after training More...
 
int maxEpoch = 1000
 number of epochs while training More...
 
double stopThreshold = 0.001
 threshold for loss to prevent over-fitting More...
 
double eta = 0.0051
 learning rate More...
 
int batchSize = 5
 number of elements per batch More...
 
bool verbose = false
 use verbose output during fitting More...
 

Detailed Description

only include Magick++ if needed

Image data set representation

Constructor & Destructor Documentation

◆ ImageDataSet()

ImageDataSet::ImageDataSet ( size_t  inputCount,
size_t  outputCount 
)
inline

default constructor

Parameters
inputCount
outputCount

Member Function Documentation

◆ Cache()

void ImageDataSet::Cache ( )
inline

loads data set into memory

we split the dataset into

  • 80% training
  • 20% validation
  • 0% test

Example: 100 images => 80 training, 20 validation, 0 test

◆ PrepareDirectory()

virtual void ImageDataSet::PrepareDirectory ( const char *  filePath)
inlinevirtual

prepares a new set of data based on passed filePath

Parameters
filePathpath name of directory to prepare

identifies "classes" as files in nested directories

Reimplemented from DataSet.

Member Data Documentation

◆ classes

std::vector<MatrixDS<bool> > ImageDataSet::classes

representation of all classes

◆ classNames

std::vector<std::string> ImageDataSet::classNames

representation of all class names

◆ imageHeight

size_t ImageDataSet::imageHeight = 180

desired image height

◆ imageWidth

size_t ImageDataSet::imageWidth = 180

desired image width

◆ totalCount

size_t ImageDataSet::totalCount = 0

total number of data records

◆ trainDirectory

const char* ImageDataSet::trainDirectory = "../../resources/image_classification/training/"

target directory for training

◆ trainingCount

size_t ImageDataSet::trainingCount = 0

number of training data records

◆ validationCount

size_t ImageDataSet::validationCount = 0

number of validation data records

◆ validationShare

double ImageDataSet::validationShare = 0.2

percentage of validation data


The documentation for this class was generated from the following file: