
Hello everyone

I think that the importance of the moment deserves a new topic.
Previous methods of the API load the full set of training images into memory. This was ok or even stretched with:
For a dataset with 1.8 million images, keeping everything into RAM wouldn't work. Places2 standard has 1.8 million training images:
http://places2.csail.mit.edu/download.htmlFor my own tests, I'm downloading "Small images (256 * 256) with easy directory structure with 21GB".
A solution for this is currently in testing. The folder structure is loaded into RAM with:
FTrainingFileNames, FValidationFileNames, FTestFileNames: TFileNameList;
...
ProportionToLoad := 1;
CreateFileNameListsFromImagesFromFolder(
FTrainingFileNames, FValidationFileNames, FTestFileNames,
{FolderName=}'places_folder/train', {pImageSubFolder=}'',
{TrainingProp=}0.9*ProportionToLoad,
{ValidationProp=}0.05*ProportionToLoad,
{TestProp=}0.05*ProportionToLoad
);
There is a new fitting class capable of working with the above:
NeuralFit := TNeuralImageLoadingFit.Create;
...
NeuralFit.FitLoading({NeuralNetworkModel}NN, {ImageSizeX}256, {ImageSizeY}256, FTrainingFileNames, FValidationFileNames, FTestFileNames, {BatchSize}256, {Epochs}100);
Is it bug free? I don't know. It's currently in testing. My current test case is modifying a source code intended for Plant Village dataset by just switching the folder name:
https://github.com/joaopauloschuler/neural-api/blob/master/examples/SimplePlantLeafDisease/SimplePlantLeafDiseaseLoadingAPI.pasWhen creating the model (the neural network), the number of classes comes straight from the dataset:
NN.AddLayer([
TNNetInput.Create(FSizeX, FSizeY, 3),
...
TNNetFullConnectLinear.Create(FTrainingFileNames.ClassCount),
TNNetSoftMax.Create()
]);

Wish everyone happy pascal coding. May the source be with you.
