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

Unnecessary Operation? #3

Open
RylanSchaeffer opened this issue May 9, 2021 · 2 comments
Open

Unnecessary Operation? #3

RylanSchaeffer opened this issue May 9, 2021 · 2 comments

Comments

@RylanSchaeffer
Copy link

This line is tripping me up:

https://github.com/csmfindling/behavior_models/blob/master/models/expSmoothing_prevAction.py#L48

As far as I can tell, it does nothing. I added an assert statement to check its size is zero and no error was thrown.

@RylanSchaeffer
Copy link
Author

RylanSchaeffer commented May 9, 2021

Ok, I think I figured out what's going on: you're trying to handle trials in which no action was taken, so you filter these using act[:,t-1]!=0. The aforementioned line is then to propagate values forward one time step in the trials where no action was taken.

@RylanSchaeffer
Copy link
Author

If this is correct, I would strongly recommend adding an explanatory comment or changing the implementation to be more clear. Adding an if statement might be a tad slower, but it would be a hell of a lot more clear.

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