Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed save and load NARRE model #517

Merged
merged 2 commits into from
Jul 21, 2023
Merged

Fixed save and load NARRE model #517

merged 2 commits into from
Jul 21, 2023

Conversation

lthoang
Copy link
Member

@lthoang lthoang commented Jun 28, 2023

Description

The current version cannot save NARRE model when specify save_dir in Experiment.

This change is mandatory for NARRE to save its weights.

Related Issues

Checklist:

  • I have added tests.
  • I have updated the documentation accordingly.
  • I have updated README.md (if you are adding a new model).
  • I have updated examples/README.md (if you are adding a new example).
  • I have updated datasets/README.md (if you are adding a new dataset).

@tqtg
Copy link
Member

tqtg commented Jun 28, 2023

Can we elaborate more on the root cause? Is it because of changes in TensorFlow? Also, do we need to check the load function and make sure it works properly?

@lthoang lthoang changed the title Fixed save NARRE model Fixed save and load NARRE model Jul 13, 2023
@lthoang
Copy link
Member Author

lthoang commented Jul 13, 2023

Can we elaborate more on the root cause? Is it because of changes in TensorFlow? Also, do we need to check the load function and make sure it works properly?

Both tensorflow model and optimizer need to be saved separately (detached from the model). For load function, the optimizer needs the saved weights for enabling adaptive learning rate approaches such as Adam and RMSProp.

layers.Dropout(rate=self.dropout_rate, name="item_Oi")(
tf.reduce_sum(layers.Multiply()([item_attention, item_review_h]), 1)
)
self.graph = Model(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as for the HDRModel

@lthoang lthoang requested a review from tqtg July 21, 2023 16:41
@lthoang lthoang merged commit 3ef1678 into PreferredAI:master Jul 21, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants