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

Enhanced the get() function of Plato's model register #264

Merged
merged 3 commits into from
Nov 22, 2022

Conversation

CSJDeveloper
Copy link
Collaborator

This is a series of work related to PR#263. To be specific, following the same target and mechanism of adding **kwargs argument, this PR aims to enhance the get() functions of registry.py under models folder of Plato.

Description

Following the same motivation as PR#263, the modification purpose of this PR is to allow the get() function to support more flexible and extensive model definitions.

For example, in the personalized federated learning domain, the global model can be defined by calling model_registry.get() while the personalized model can be directly defined by calling

model_registry.get(
model_name=Config().trainer.personalized_model_name, 
model_params=Config().parameters.personalized_model._asdict()
)

How has this been tested?

Two tests, including the examples and the unit test running, are performed to guarantee that this modification does not influence the existing Plato code and supports the personalized model definition.

More details can be accessed in the PR#263.

For convenience and clarity, we show how to run unit tests below.

After switching to Plato's root folder, you can run

plato@user:~$ python tests/personalization_tests.py

Types of changes

  • Bug fix (non-breaking change which fixes an issue) Fixes #
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code has been formatted using Black and checked using PyLint.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for platodocs canceled.

Name Link
🔨 Latest commit 1094615
🔍 Latest deploy log https://app.netlify.com/sites/platodocs/deploys/637d4b3babc9730008dc2ae3

@baochunli baochunli merged commit 9d5902c into main Nov 22, 2022
@baochunli baochunli deleted the enhance_model_definition branch November 22, 2022 22:53
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