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

Add patience to reduce LR as CTM argument #141

Open
drodrigues0 opened this issue Aug 28, 2023 · 1 comment
Open

Add patience to reduce LR as CTM argument #141

drodrigues0 opened this issue Aug 28, 2023 · 1 comment

Comments

@drodrigues0
Copy link

drodrigues0 commented Aug 28, 2023

  • Contextualized Topic Models version: 2.5.0
  • Python version: 3.9.16
  • Operating System: Ubuntu 20.04.6 LTS

Description

Currently, ReduceLROnPlateau function for CTM has a high hard-coded value for patience. So, whenever you want the LR to decrease during training we need to set the EarlyStopping patience to some value higher than 10, otherwise the train stops before the LR is actually decreased.

This is impractical because, waiting 10 epochs for the LR to decrease is a lot.

Code line

Propose to fix it

class CTM:

    # ...

    def __init__(
        self,
        # ...
        reduce_on_plateau=False,
        lr_patience: int = 3
        # ...
# init lr scheduler
if self.reduce_on_plateau:
    self.scheduler = ReduceLROnPlateau(self.optimizer, patience=sefl.lr_patience)
@vinid
Copy link
Contributor

vinid commented Aug 28, 2023 via email

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