# Week 1 - Assignment 3: Differences between djmodel and music\_inference\_model?

**URL:** <https://community.deeplearning.ai/t/week-1-assignment-3-differences-between-djmodel-and-music-inference-model/234221>\
**Category:** Sequence Models\
**Tags:** coursera-platform\
**Created:** [November 23, 2022, 9:49pm UTC](https://community.deeplearning.ai/t/week-1-assignment-3-differences-between-djmodel-and-music-inference-model/234221 "2022-11-23T21:49:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harvey\_Wang](https://avatars.discourse-cdn.com/v4/letter/h/9de0a6/32.png) [@Harvey\_Wang](https://community.deeplearning.ai/u/Harvey_Wang)\
**Post date:** [November 23, 2022, 9:49pm UTC](https://community.deeplearning.ai/t/week-1-assignment-3-differences-between-djmodel-and-music-inference-model/234221/1 "2022-11-23T21:49:05Z")

</div>

In the assignment, we build two models. But I want to know the difference between them.

From what the instructions say, `djmodel` learns the style of the music and predicts the next note and `music_inference_model` predicts a series of notes using each note’s respective previous note. The wording in the instructions makes it sound like they do the same thing, which is where my confusion comes from.

So, if I’m understanding correctly, `djmodel` is learning the patterns of the music to know what notes to predict. And `music_inference_model` uses the learned patterns to predict a note, and then furthermore feeds the predicted note into the next cell. So, it seems like `music_inference_model` takes the function of `djmodel` one step further.

(I apologize for the repetitiveness. I had asked a similar question, but deleted it after realizing I misinterpreted the instructions.)

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [November 23, 2022, 10:05pm UTC](https://community.deeplearning.ai/t/week-1-assignment-3-differences-between-djmodel-and-music-inference-model/234221/2 "2022-11-23T22:05:13Z")

</div>

I believe that djmodel is used for training, and the inference model is used for generating new music using the djmodel weights.

---

<div class="post-metadata">

**Author:** ![Harvey\_Wang](https://avatars.discourse-cdn.com/v4/letter/h/9de0a6/32.png) [@Harvey\_Wang](https://community.deeplearning.ai/u/Harvey_Wang)\
**Post date:** [November 24, 2022, 12:00am UTC](https://community.deeplearning.ai/t/week-1-assignment-3-differences-between-djmodel-and-music-inference-model/234221/3 "2022-11-24T00:00:21Z")

</div>

That’s what I could gather. But it’s a little odd that we have one model dedicated solely to training.

I’m guessing this is another case of transfer learning. We implement a model to learn the style and predict notes, so we take the parameters to train a similar network.

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [November 24, 2022, 4:41am UTC](https://community.deeplearning.ai/t/week-1-assignment-3-differences-between-djmodel-and-music-inference-model/234221/4 "2022-11-24T04:41:37Z")

</div>

> [@Harvey\_Wang](#):
>
> so we take the parameters to train a similar network.

No, I don’t think that’s what’s happening. There are some global variables that are used to apply the learning from training to making the music predictions.

The keys are in this block of text:

 ![image](https://global.discourse-cdn.com/dlai/original/3X/7/2/72f8ac77bcb4c3e6fe4f11c0d7d789358d76a6a6.png)

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [November 24, 2022, 4:44am UTC](https://community.deeplearning.ai/t/week-1-assignment-3-differences-between-djmodel-and-music-inference-model/234221/5 "2022-11-24T04:44:33Z")

</div>

This bit of code is what ties the two parts of the assignment together:

 ![image](https://global.discourse-cdn.com/dlai/original/3X/4/0/40c89511c86fca4affea3f582c20a750da953bdc.png)

---

<div class="post-metadata">

**Author:** ![Harvey\_Wang](https://avatars.discourse-cdn.com/v4/letter/h/9de0a6/32.png) [@Harvey\_Wang](https://community.deeplearning.ai/u/Harvey_Wang)\
**Post date:** [November 24, 2022, 6:28am UTC](https://community.deeplearning.ai/t/week-1-assignment-3-differences-between-djmodel-and-music-inference-model/234221/6 "2022-11-24T06:28:58Z")

</div>

I’m still confused at where I am wrong.

I know the two networks use the same weights and biases, but `music_inference_model` isn’t exactly the same as `djmodel`, which is why I said `music_inference_model` is a similar model. Or are my semantics wrong? That is, this wouldn’t be a case of transfer learning.
