-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Conversation
@microsoft-github-policy-service agree |
qlib/data/dataset/__init__.py
Outdated
return tsds | ||
|
||
|
||
__all__ = ["Optional", "Dataset", "DatasetH"] | ||
__all__ = ["Optional"] |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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
Outdated
@@ -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 ( |
There was a problem hiding this comment.
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()
…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 <[email protected]>
…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 <[email protected]>
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