I am struggling to find an approach for training an RNN with unequal sequence lengths. I have a varying number of sequential observations for each sample in my dataset. Each observation represents a connection in a social network graph that was made. If two samples have different sized networks, they will have different length sequences.
The recommended approach in
keras seems to be to pad all observations so that each is as long as the longest in the sample. This ensures they are the same size but uses a lot more memory if the longest sequence is indeed very long.
Are there other approaches to feeding sequence data of varying length to an RNN specifically using the Rstudio version of
keras? An example using the
fit_generator method would be very welcome as I am quite new to DL.