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

update TSDataSampler refineing the memory layout of data array to speed up NN training #1342

Merged
merged 6 commits into from
Nov 11, 2022

Conversation

peteryang1
Copy link
Collaborator

Description

update TSDataSampler refineing the memory layout of data array to speed up NN training

Motivation and Context

update TSDataSampler refineing the memory layout of data array to speed up NN training

Types of changes

  • Fix bugs

@peteryang1
Copy link
Collaborator Author

@microsoft-github-policy-service agree

return tsds


__all__ = ["Optional", "Dataset", "DatasetH"]
__all__ = ["Optional"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we have to remove "Dataset", "DatasetH"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it seems to be deleted by some auto format, I think it should not be deleted.

qlib/data/dataset/__init__.py Show resolved Hide resolved
@@ -532,15 +565,21 @@ def __getitem__(self, idx: Union[int, Tuple[object, str], List[int]]):
# precision problems. It will not cause any problems in my tests at least
indices = np.nan_to_num(indices.astype(np.float64), nan=self.nan_idx).astype(int)

data = self.data_arr[indices]
if (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this be safer?
(np.diff(indices) == 1).all()

@you-n-g you-n-g merged commit a82cc0b into microsoft:main Nov 11, 2022
@you-n-g you-n-g added the enhancement New feature or request label Dec 9, 2022
qianyun210603 pushed a commit to qianyun210603/qlib that referenced this pull request Mar 23, 2023
…ed up NN training (microsoft#1342)

* update TSDataSampler

* reformat code with black

* use pre-commit to reformat the code

* Add documents

* More docstring

* More Safety

Co-authored-by: Young <afe.young@gmail.com>
qianyun210603 pushed a commit to qianyun210603/qlib that referenced this pull request Mar 23, 2023
…ed up NN training (microsoft#1342)

* update TSDataSampler

* reformat code with black

* use pre-commit to reformat the code

* Add documents

* More docstring

* More Safety

Co-authored-by: Young <afe.young@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants