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

Enable empty split #466

Merged
merged 3 commits into from
Dec 8, 2022
Merged

Enable empty split #466

merged 3 commits into from
Dec 8, 2022

Conversation

rayrayraykk
Copy link
Collaborator

No description provided.

@rayrayraykk rayrayraykk added the bug Something isn't working label Dec 8, 2022
@rayrayraykk rayrayraykk requested a review from joneswong December 8, 2022 06:44
@rayrayraykk rayrayraykk linked an issue Dec 8, 2022 that may be closed by this pull request
Copy link
Collaborator

@joneswong joneswong left a comment

Choose a reason for hiding this comment

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

In my opinion, when there is no train split, users should be responsible for failure of accessing train split. So this behavior is ok:

for x, y in self.data['train']:

As for val and test splits, what is our intended behavior?

@joneswong
Copy link
Collaborator

In my opinion, when there is no train split, users should be responsible for failure of accessing train split. So this behavior is ok:

for x, y in self.data['train']:

As for val and test splits, what is our intended behavior?

e.g., is this still ok?

for x, y in self.data[target_data_split_name]:

@rayrayraykk
Copy link
Collaborator Author

rayrayraykk commented Dec 8, 2022

In my opinion, when there is no train split, users should be responsible for failure of accessing train split. So this behavior is ok:

for x, y in self.data['train']:

As for val and test splits, what is our intended behavior?

e.g., is this still ok?

for x, y in self.data[target_data_split_name]:

Now, val and test splits follow the same principle in GeneralTorchTrainer. But users are free to set the rules for no val and test splits in user-defined trainer, e.g.

if target_data_split_name not in self.data:
    do nothing
    return {f'{target_data_split_name}_loss': 0,
                f'{target_data_split_name}_total': 0,}

joneswong
joneswong previously approved these changes Dec 8, 2022
Copy link
Collaborator

@joneswong joneswong left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@joneswong joneswong left a comment

Choose a reason for hiding this comment

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

approved. It seems that we'd better make our proj more "typed".

@joneswong joneswong merged commit 2cb5585 into alibaba:master Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable empty split
2 participants