I posted How to use Mathematica to train a network Using out of core classification? some month ago.
The network receive some fixed-length input and produce another fixed-length output,this is How to use Mathematica to train a network Using out of core classification? what to do.
But for RNN,it receive some varing-length input and produce something.
In this example,it's a LSTM auto-encoder.
subnet = NetChain[{
LongShortTermMemoryLayer[128, "Input" -> {"Varying", 43}],
SequenceLastLayer[], ReplicateLayer[Automatic],
LongShortTermMemoryLayer[43]
}];
net = NetInitialize @ NetGraph[{subnet, MeanSquaredLossLayer[]},
{NetPort["Input"] -> 1 -> {NetPort[2, "Input"], NetPort["Output"]},
NetPort["Input"] -> NetPort[2, "Target"]}]
data = Table[RandomReal[1, {RandomInteger[{5, 50}], 43}], 100];
NetTrain[net, <|"Input" -> data|>, "Loss"]
(*NetTrain::interr: An internal error occurred. Please contact Wolfram Research.*)
Because the dimension of data is $N*43$ ,it can't be stored in HDF5 file.
In MXNet,I write a custom iterator to read the data.
But training in MXNet seem has some problem that is the loss can't be very low.So I want to check this in Mathematica.