p-lambda / wilds

A machine learning benchmark of in-the-wild distribution shifts, with data loaders, evaluators, and default models.
https://wilds.stanford.edu
MIT License
551 stars 128 forks source link

Enhance WILDSSubset to support flexible data returns #156

Open rdarbinyan opened 9 months ago

rdarbinyan commented 9 months ago

Summary

This update modifies the WILDSSubset class to support flexible return types from its __getitem__ method, accommodating both standard and custom dataset requirements. The enhancement allows for varied data returns, from basic x and y pairs to more complex structures including additional information like background labels. Importantly, this change is backward compatible, ensuring existing datasets continue to function as before.

Changes

Conclusion

By introducing this backward-compatible enhancement, the WILDS library becomes more adaptable and user-friendly, encouraging contributions and customizations that meet diverse research and application needs.