C5 W1 - Jazz Improv HW - What is the relationship between Exercise 2 and 3?

Most of the homeworks have built upon each other, but i can’t seem to establish the relationship between these two exercises. Are we building the model in exercise 2 and then using it in exercise 3? Are they independent of each other? Something else?

They’re examples of applying RNNs to different types of problems.

  • Dino Island predicts letters to build new words.
  • Jazz predicts notes to build new music.

Thanks for replying - Sorry i’ll be more clear: within the Jazz Improv HW itself, how do questions 2 and 3 relate?

What do you mean exactly by “questions 2 and 3”?

Are you referring to
“2 Building the Model”
“3 Generating Music” ?

Yes, exactly. Why did we create djmodel and never to use it below? And how does it relate to what music_inference_model does? My (probably faulty) assumption was that djmodel would build the model, and then we’d implement a prediction scheme using this same djmodel. So i’m not sure the motivation for creating the music_inference_model and not leveraging the djmodel.

The doctext for music_inference_model() says that LSTM_cell() is a global resource that is shared between djmodel() - where it is trained - and the music_inference_model() for generating new notes.

1 Like

Ok… i think i’m getting it a little bit. But maybe i’m not used to the rnn/keras training path… I’m used to a classic training/fit to a model object and then scoring from that model object.

Could you explain these three thing that would really help me to understand:

  1. Why do we not use the model object itself from part 2?
  2. Is that a typical RNN strategy to only train and transfer the ‘shared’ cell?
  3. How/where does the LSTM_cell object itself get updated when we train the Keras model object? and Is that common knowledge to folks familiar with the keras package that this object gets updated during training?

I can’t answer your questions, because I agree with you - I don’t understand why the assignment was built this way.

Thanks @TMosh. Glad to know my confusion is shared. Maybe someone else will chime in!

Hey, according to me the key difference is that in dinosaur assignment, the input at every time stamp was an integer representing the character whereas in jazz music one, we had input as vector representation so it introduced us to vectorized form of input that is most commonly used while building different RNN models and also it lays foundation for word embeddings in next week which are also in vector representation. Coming to later part of the question, models used in both assignments are independent of each other as for dinosaur assignment we have built the model from scratch specifically for character level language model whereas in the later one we have used keras library which provides lot of flexibility.