A doubt in Week 1 Assignment (Jazz Solo)

Dear Mentor,

Could you please guide me on this issue?

Assignment: Improvise a Jazz Solo with an LSTM Network
→ 2 - Building the Model
----> Train the model

m = number of training examples
Tx , Ty = number of timesteps
n_values = number of unique musical values
n_a = number of hidden units in LSTM cell

The shape of X is (m, Tx, n_values)
The shape of a0 and c0 is (m, n_a)

model.fit([X, a0, c0], list(Y), epochs=100, verbose = 0)

To train the model by using the model.fit() function, this assignment suggests us to adjust the shape of Y to be (Ty, m, n_values), which is different from the shape of X, i.e. (m, Tx, n_values).

After that, apply list() function on Y to form a list of Y by breaking into Ty items, where each of the items is of shape (m, n_values).

In this case, the input data to the model.fit() function is [X, a0, c0], or [ (m, Tx, n_values) , (m, n_a) , (m, n_a) ] , which is a list with only 3 items.

While the target data is [ (m, n_values) … (m, n_values) ], which is a list with Ty items, where each of the items is of shape (m, n_values).

May i know how does it work when the shape of both X and Y, and the size of input and target data do not match?

Thank you.

Please notice that the model outputs a bunch of tensors. To be specific, the output consists of 30 tensors, each of shape (None, 90) which corresponds to shape (batch size, number of features per timestep).