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

rolling_window_sequences primitive does not support target_size=0 #205

Open
AlexanderGeiger opened this issue Oct 9, 2019 · 0 comments
Open

Comments

@AlexanderGeiger
Copy link
Contributor

The rolling_window_sequences primitive is not allowing a target_size of 0, in which case an out-of-bounds error will be raised for the line y_index.append(index[end]).
The reason is the way we iterate over the arrays, where in the last iteration end is equal to len(index).

However, it would be quite useful to specify target_size=0 in cases where we do not have targets/predictions, but rather only want to create rolling input windows. (Examples would be the CycleGAN primitive or any other reconstruction based models like Autoencoder).

One potential solution would be to check if target_size>0.

...
out_X.append(X[start:end])
X_index.append(index[start])
if target_size>0:
    out_y.append(target[end:end + target_size])
    y_index.append(index[end])
...

This way we would return an empty arrays for the target values and target index if target_size=0.

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

No branches or pull requests

1 participant