Skip to content

Added abstract functions for LM and distmod #12

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

Closed
wants to merge 5 commits into from

Conversation

rohanmodi2810
Copy link
Collaborator

Description

Converted the LM and distmod functions in the doc to abstract functions in the library. I've added the calculate_probability() and sample() functions for the LanguageModel class. I've created a new class called DistributionModifier and added functions for each operators.

References

Copy link
Contributor

@neubig neubig left a comment

Choose a reason for hiding this comment

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

Hey @rohanmodi2810 , thanks a lot for doing this! Can I suggest an alternative structure?

class DistributionModifier:
    def __call__(base: LanguageModel, **kwargs):
        ...

class Fitter(DistributionModifier):
    def __call__(base: LanguageModel, target: LanguageModel, **kwargs):
        ...

...

etc.

So that each type of distmod function is a child class of distmod itself.

In addition, could we put all of these functions in the llments/distmod directory instead of llments/lm?

@rohanmodi2810 rohanmodi2810 requested a review from neubig February 29, 2024 03:25
@neubig
Copy link
Contributor

neubig commented Mar 2, 2024

Superseded by #15, which we merged in already.

@neubig neubig closed this Mar 2, 2024
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.

2 participants