New `Stimulus` class wrong shape of output
caglorithm opened this issue · 6 comments
so, the short answer is: it's correct (for MultiModel
).. for core neurolib models, you should always use to_ model()
and not as_array()
long answer: all stimuli and the classes behind them were created for MultiModel
only at first... the idea was that as_cubic_splines()
would be necessary for jitcdde
backend with adaptive dt, and as_array()
would be for numba
backend.. numba
backend currently expects the model input to be as (time, space)
even when space == 1...
what to do:
- leave it as is, core neurolib would use
to_model
which returns actually(space, time)
.. the example notebook on this uses onlyto_model()
so the users "should know".. (yes, I need to write the proper documentation ;) ) - change model input shape that
numba
backend expects to match it with core neurolib models... then, bothto_model()
andas_array()
would return the same shape as(space, time)
.. this would not change anything for the user, as basicMultiModel
user-facing interface does not require her to mess around withas_array
oras_cubic_splines
, as this is done automatically onMultiModel.run()
Uhhm, then the problem is deeper than I expected.
We are using the (space, time)
convention everywhere and it should have been the same for multimodel as well. I didn't notice this when I did the review. That means that we have to also fix multimodel as well as the output of as_array()
...
Multimodel will fail after fixing it I suppose?
how do you mean? the tests? or when people use MultiModel
? It is not a breaking change, when people use MultiModel
via its wrapper they do not create these inputs by themselves, so nothing will change for anyone... the changes would be inside string function that is translated to numba
and the shape that as_array()
function of stimuli returns
I would suggest merging #162
makes sense, I would rebase #162 on current master anyhow, wait for tests and then we can merge