Comments (11)
It might be due to randomness right?
The test_icm_square
function uses square_1 variable.
This variable is a random variable with noise, which, in theory could provide values that the icm_ising model does not have a difference between the beta value of 0 and 2.
I am not sure if it is necessary to compare between the two beta values, but we could change the test to like test_square_iter
which compares the initial segmentation and the output of the icm_ising model.
from dipy.
It shouldn't take too long. I can do that
from dipy.
Thank you for this report.
I agree, this is hard to reproduce locally but I am pretty sure this is due to a cast
from dipy.
Might be the case that it is due to a cast, but results should be consistent across runs as well, isn't it?
from dipy.
Do you have time to take the lead on that @pjsjongsung? I am ok with the proposed solution.
from dipy.
I'm fine with the result being 0 for a given random value, but this value should be fixed across runs, the very same way we get the exact same result when fixing a random seed, if I am not missing something.
Changing the check of the test will not resolve the underlying issue (provided that the above assumption is correcta). Fixing it and adding the new additional check may be more appropriate IMO.
from dipy.
It seems we can set a seed, which will be same across platform, but not across numpy versions.
However, it might still be stable enough, and all we would have to do is change the seed if it does not work on newer numpy version.
Alternatively, we could give a few more chances for test by setting a for loop with say 10 iters, and randomizing the number every loop. If the test does not take a lot of time, it won't be a bottleneck but still make the test much more stable.
from dipy.
The ultimate problem is that there is a noticeable chance of the result being 0 than expected.
I am not entirely sure what the test is supposed to check, but if such comparison between two beta values are necessary, and want to completely remove any possibility of having a random assertion failure, we could also load the file with some random values that we know will pass the check.
I did a similar thing with the DL models using figshare.
from dipy.
Have not studied closely the behavior, but having consistent results on one platform, for a NumPy versions seems to me the first step to have a test pass. Then if the result can still be 0, then there is a bug, the check needs to be changed using your suggestions, or it is not the right check to have.
from dipy.
Ok. To summarize what we can do for now is just include seeds in the random functions. This would be a temporary fix because as numpy versions change, the errors could come back.
In the later versions, we could think about why the test exists and what we want to do about it.
Sounds reasonable? @jhlegarreta @skoudoro ?
from dipy.
This would be a temporary fix because as numpy versions change, the errors could come back.
IMO fixing the seed is always a must unless some intended, documented, and expected randomness (including the appropriate assert checks in such case) is necessary.
It can even fail now if the seed happens to provide a 0 result.
But yes, IMO this is a first step @pjsjongsung 💯. Thanks.
Maybe a decorator can be written so that we do not need to write the same two Python statements on every function that uses some randomness and the behavior becomes apparent at first sight.
from dipy.
Related Issues (20)
- Horizon needs a home button which realigns the view to the z slice we are at.
- ENH: Add neighboring DWI correlation QC metric HOT 5
- scipt.opt.approx_fprime not good enough HOT 6
- Simplify or remove the use of mpl_tri in viz module
- 1.9.0 system test failures HOT 3
- ENH: Add lazy_loader HOT 2
- Tract profiles in afq example look all wrong HOT 2
- Need specific area zooming for horizon HOT 1
- Improve consistency of affine_registration docstring HOT 6
- Update `trilinear_interpolate4d` to accept float and double
- Setting `Legacy=True` SH basis is not possible for SH models HOT 3
- Allow to define optional file to fetch HOT 3
- Improving MPPCA performance HOT 6
- Tissue prior output volumes in random order HOT 13
- Issue with CWLS in dki HOT 5
- Remove`sagital` from de codespell ignore list.
- Coverage build failing on and off in to a numpy-related statement
- Allow `interp_rbf` to accept tensor-valued spherical functions HOT 1
- Broken source installation HOT 1
- Create `DiffeomorphicMap` object with saved nifti forward warp data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dipy.