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

ETM training leading to NaN loss #62

Closed
PearlSikka opened this issue Jul 3, 2022 · 3 comments
Closed

ETM training leading to NaN loss #62

PearlSikka opened this issue Jul 3, 2022 · 3 comments

Comments

@PearlSikka
Copy link

PearlSikka commented Jul 3, 2022

  • OCTIS version: 1.10.4
  • Python version: 3.7.13
  • Operating System: Windows

Description

I'm running topic model for tweets using ETM model. While training, it led to NaN loss in the first epoch and hence, the training doesn't go further epochs. The ETM model is being trained with default parameters.

model = ETM(num_topics=10) #command run
output = model.train_model(dataset)

Output:
Epoch: 1 .. batch: 20/25 .. LR: 0.005 .. KL_theta: nan .. Rec_loss: nan .. NELBO: nan


![tm_fail](https://user-images.githubusercontent.com/70057374/177056948-277f8d0f-9b57-4884-ab60-c79827ff5b8b.png)

@silviatti
Copy link
Collaborator

Hello,
this is an issue related to the original implementation of ETM. We took the model and integrated into OCTIS. Looking at a related issue in the original repo (adjidieng/ETM#3), it seems that lowering the learning rate could help. The other two parameters (bow_norm and activation_function) are okay by default.
Otherwise you can try using a different model, e.g. CTM seems to work well on short texts as tweets.

Let me know if it helps,

Silvia

@PearlSikka
Copy link
Author

PearlSikka commented Jul 4, 2022

Thank you Silvia for your quick response. I tried training ETM with lower learning rate as well but it still shows NaN loss. Maybe I can leverage CTM model. Thanks again!

@silviatti
Copy link
Collaborator

Okay, then I'll close the issue. Feel free to re-open it or open a new issue if you have other questions.

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

No branches or pull requests

2 participants