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

PR #14: Update example code in timeseries_dataset.py #789

Closed
wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link

PR #14: Update example code in timeseries_dataset.py

Imported from GitHub PR #14

I have gone through the example-2 in the TF documentation of keras.utils.timeseries_dataset_from_array. With existing code we can only generate one batch of dataset.In TF forum one of the user raised concern that users may confuse why we are using input_data = data[:-10] as it can generate only one batch and there will be loss of data and users may confuse -10 as sequence_length here. Though the intention in the example is to demo on generating batches of data using the API,Its better to use input_data = data[:] to avoid confusion and also it give correct demo to generate the total possible no of batches without loss of data.

Also I am adding the sequence_length as variable in the code to avoid hard coding in the data indexing which will make it better understandable.

Thanks!
Copybara import of the project:

--
84651ad by Surya [email protected]:

Update example code in timeseries_dataset.py

I have gone through the example-2 in the TF documentation of keras.utils.timeseries_dataset_from_array. With existing code we can only generate one batch of dataset.In TF forum one of the user raised concern that users may confuse why we are using input_data = data[:-10] as it can generate only one batch and there will be loss of data. Though the intention in the example is to demo on generating batches of data using the API,Its better to use input_data = data[:] to avoid confusion and also it give perfect demo to generate the total possible no of batches without loss of data.

Also I am adding the sequence_length as variable in the code to avoid hard coding in the data indexing which will make it better understandable.

Thanks!

e8da674 by Surya [email protected]:

Update timeseries_dataset.py

Fixed the lint errors

baa074b by Surya [email protected]:

Update formatting errors timeseries_dataset.py

Done changes for black formatting.

Merging this change closes #14

FUTURE_COPYBARA_INTEGRATE_REVIEW=#14 from SuryanarayanaY:patch-1 baa074b

Copy link

google-cla bot commented Jul 29, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant