I have some nicely formatted training data in HDF5 files, i.e. the images and labels are serialized within the H5 file as groups and datasets.
AFAIK NetTrain
only works in an out-of-core mode on lists of paths each wrapped in File
.
Is there any way to get NetTrain
to work off of the training data stored in an H5 file efficiently (with parallelized batch loading)?
Update from comment:
@AlexeyGolyshev suggested to use @TaliesinBeynon's undocumented answer which doesn't seem to work anymore in v11.3:
{input, output} = RandomReal[1, {2, 1000, 2}];
<< GeneralUtilities`;
fn = FileNameJoin[{CreateDirectory[], "test.h5"}]
ExportStructuredHDF5[fn, <|"Input" -> input, "Output" -> output|>];
NetTrain[LinearLayer["Input" -> 2, "Output" -> 2], File[fn]]
ValidationSet
). i.sstatic.net/f1W0n.png $\endgroup$