-
Notifications
You must be signed in to change notification settings - Fork 4
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
Inconsistent dimensions for n-dimensional arrays. #54
Comments
Hi Andy, Thanks for raising this issue. I see it as well. Back to the drawing board... |
Hi Andy ( @AndyPohlNZ ), the issue was caused by the update_json_files() function in StanBase.jl. I just pushed StanBase.jl v4.7.3 which I think should fix the problem. I have not seen a model to check the results of the fix. Also, I'm a bit concerned this is another point solution, not something that deals with Array{T, N} in general. |
Hi Rob, See this slightly more complex example which I hope is a useful test case for testing dimensions of both input and output:
Error suggests dimensions are still inconsistent: |
Hi Andy, just in the process of pushing StanBase.jl v4.7.4. This afternoon, driving up to the mountains here in Colorado, I realized a better approach is to simply permutedims() the input matrix if we go from Julia to Stan. The new version checks if the I wrote a simple test program that I think demonstrates it works for 2, 3 and 4 (and up) dimensions:
which I'm adding to the StanSample test set. I'll try your test script above but I think to Stan |
I'm getting:
which I think is correct. |
I can confirm that things seem to be working correctly with StanBase v.4.7.4. Thanks so much for your quick turnaround with this issue! Enjoy the mountains :). |
Hi Andy, is it ok if I add your script as a test case? It's a great example! Thanks for you help, it has bothered me a long time that the JSON stuff was never put to the test. |
Hi Rob. Absolutely feel free to add the example as a test case. |
c7a425a Allow JSON data as a string (#60) 50fe2ec Update README examples section e380e82 Reword docstrings fb513e3 Reorganize and update documentation (#57) 96805fd Compile methods: split stanc args from make args, add default include path (#58) f62bf46 Fix broken link 676db6b Bump actions/setup-python from 2 to 4 (#55) 34f10dd Remove CmdStan Dependency (#51) 821883f Prefix any C-exposed symbols with `bs_` (#54) 81129b0 Add the option for autodiff Hessian calculations (#52) git-subtree-dir: deps/data/bridgestan git-subtree-split: c7a425aac54120bafa643b722ed24b2a32111782
Hi Rob,
Thanks for putting work into getting stan and julia playing nice together and for the fix to the above issue. Sorry for raising this but the fix implemented does not seem to generalize to multidimensional arrays. I am using the master branch of StanSample:
StanSample v6.9.2 https://github.com/StanJulia/StanSample.jl#master
. See the modified example below:Returns the following error:
Exception: mismatch in dimension declared and found in context; processing stage=data initialization; variable name=x; position=0; dims declared=(50,2,27); dims found=(27,2,50)
Originally posted by @AndyPohlNZ in #51 (comment)
The text was updated successfully, but these errors were encountered: