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

Bug in util/ArrayUtils.java clip #534

Open
angers2807 opened this issue Feb 6, 2018 · 1 comment
Open

Bug in util/ArrayUtils.java clip #534

angers2807 opened this issue Feb 6, 2018 · 1 comment

Comments

@angers2807
Copy link

public static double[] clip(double[] values, double min, double max) { for (int i = 0; i < values.length; i++) { values[i] = Math.min(1, Math.max(0, values[i])); } return values; }
Doesn't ever reference the min and max parameters, instead it always clips to 0,1
This doesn't currently cause a problem because the only usages (in SpatialPooler) call it with params that currently happen to be 0,1 (c.getSynPermMin(), c.getSynPermMax())
However this is a bug just waiting to happen

Sorry, I'm not setup to make contributions

@cogmission
Copy link
Collaborator

Hi @angers2807,

Thanks! good catch! We'll take a look...

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

2 participants