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 sorting policy to ChunkDataset #17

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

add sorting policy to ChunkDataset #17

wants to merge 4 commits into from

Conversation

xzhu1900
Copy link
Owner

Add a sorting policy to ChunkDataset.

This is considered an advanced parameter for developers who want to apply a 'sorting policy' to the chunk data before sampling into minibatch.

Different than the collate method, this policy is applied on the chunk level. When a chunk of data is loaded (multiple chunks if cross_chunk_shuffle_count_ is greater than 1), this policy is targeting to the full loaded data. It will be useful if developers want to perform some pre-processing (like bucketing) to the chunk data before example sampler samples the data.

size_t chunk_count_;
};

auto sorting_policy = [](std::vector<int>& raw_batch_data){

Choose a reason for hiding this comment

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

Would D::BatchType& be more flexible than std::vector, as it will still be back compatible if D implementation changes to another type in the future?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes, it will be. I'll make the change in next iteration.

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