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 dicts to initializer field types for combiners #1476

Merged
merged 3 commits into from
Nov 13, 2021

Conversation

ksbrar
Copy link
Collaborator

@ksbrar ksbrar commented Nov 10, 2021

Creates a marshmallow field InitializerOrDict modeled after Embed and InitializerOptions that allows valid initializer strings or dicts with a 'type' parameter (ref - see initializer description). Sets weights_initializer and bias_initializer fields in combiners.py to use this instead of InitializerOptions

Having some Torch issues locally, but hopefully tests pass here...

@ksbrar ksbrar requested a review from tgaddair November 10, 2021 18:37
@ksbrar ksbrar self-assigned this Nov 10, 2021
@github-actions
Copy link

github-actions bot commented Nov 10, 2021

Unit Test Results

         8 files  ±0         8 suites  ±0   1h 25m 5s ⏱️ + 5m 37s
  2 921 tests ±0  2 372 ✔️ ±0     549 💤 ±0  0 ±0 
11 684 runs  ±0  9 488 ✔️ ±0  2 196 💤 ±0  0 ±0 

Results for commit 9bde1a9. ± Comparison against base commit 958a4b3.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@tgaddair tgaddair left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple small things.

{
"type": "object",
"properties": {
"type": { "type": "string" },
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should type also be one of the list of initializer_registry?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

True!

ludwig/utils/schema_utils.py Outdated Show resolved Hide resolved
@ksbrar ksbrar requested a review from tgaddair November 10, 2021 20:59
Copy link
Collaborator

@tgaddair tgaddair left a comment

Choose a reason for hiding this comment

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

LGTM!

@tgaddair tgaddair merged commit 4a97138 into master Nov 13, 2021
@tgaddair tgaddair deleted the add_dicts_to_initializer_type branch November 13, 2021 18:30
tgaddair pushed a commit that referenced this pull request Dec 16, 2021
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.

None yet

2 participants