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

[WIP] Make adding new Policy Models flexible #327

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

engmubarak48
Copy link
Collaborator

Fixes #293

This PR tries to make adding new function approximations (policy models) as flexible as possible.

  • Modification of the base.py file to dynamically import and instantiate policy models based on configuration
  • Allowing the addition of new model types (e.g., CNN, GNN, Transformer) without altering the core logic.
  • Implementation of a clean interface in the ModelBase class

@engmubarak48 engmubarak48 linked an issue Jun 18, 2024 that may be closed by this pull request
Copy link
Collaborator

@josephdviviano josephdviviano left a comment

Choose a reason for hiding this comment

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

lgtm - a comment, but non blocking.



class MLPPolicy(ModelBase):
def __init__(self, config, env, device, float_precision, base=None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I notice these inputs are never checked anywhere -- I'm wondering if some assertions, typechecks, etc. would be helpful either here or in the base class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @josephdviviano thanks, I just started.. I will let you know when it is ready for review :)

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.

Flexible Policy Definition
2 participants