Slight extension of RNN model

Hi, All,

I am looking at the introductory lesson on RNNs (Nietzsche) and I would like to extend it to a slightly more complicated case, to test my understanding. Please let me know if the text below is poorly or confusingly worded.

In the original lesson, we dealt with three “time steps” in the RNN, each taking a single character. The input array (after stacking) to ColumnarModelData representing xs was of dimension (N, 3), where N is the number of training examples. The dataloader produced vector xs of length 3 for input into the RNN.

In my minimal extension (which uses the explicitly written RNN, a great teaching tool IMHO), each character is replaced by a float vector of length Nf. Thus, each “time step” of the RNN takes as input Nf float values rather than 1 character. It is easy to build the model for this but I am having great difficulty with the dataset side. Basically, specializing to a case with three time steps, I simply replace the xs array input with an array that I construct of dimension (N, 3, Nf) or (3,Nf,N). Depending on which of these two choices I take, either the “from_arrays” call fails or the iterator fails (trying to iterate with indices up to 100 on list if length 3).

The question is: is the library easily used with this seemingly innocuous complication or should I try something else? I just need some direction of what to try. I have spent a fair amount of time perusing the code but can’t quite figure out the answer to this question.

Thanks for any help!

1 Like