-
Notifications
You must be signed in to change notification settings - Fork 6
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
make activation consistent #87
Conversation
2 similar comments
Besides randomly throwing errors, pylint always stops at some point without raising an error or something like that.. @derNarr @dekuenstle have you any idea why this happens? |
Seems like the random errors came from not giving fixed dimensions.
|
2 similar comments
@@ -22,7 +22,7 @@ def activation(event_list, weights, number_of_threads=1, remove_duplicates=None, | |||
event_list : generator or str | |||
generates cues, outcomes pairs or the path to the event file | |||
weights : xarray.DataArray or dict[dict[float]] | |||
the xarray.DataArray needs to have the dimensions 'cues' and 'outcomes' | |||
the xarray.DataArray needs to have the dimensions 'outcomes' and 'cues' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pyndl.ndl.ndl has also order 'cues','outcomes'. We have to keep this consistent. Why did you change the order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pyndl.ndl.ndl returns dimensions ('outcomes', 'cues'), so now activation is consistent with this.
But the doc string in ndl.py
"""
Returns
-------
weights : xarray.DataArray
with dimensions 'cues' and 'outcomes'. You can lookup the weights
between a cue and an outcome with ``weights.loc[{'outcomes': outcome,
'cues': cue}]`` or ``weights.loc[outcome].loc[cue]``.
"""
should be
"""
Returns
-------
weights : xarray.DataArray
with dimensions 'outcomes' and 'cues'. You can lookup the weights
between a cue and an outcome with ``weights.loc[{'outcomes': outcome,
'cues': cue}]`` or ``weights.loc[outcome].loc[cue]``.
"""
1 similar comment
2 similar comments
Harmonizes return value dimension order with activation dict of dicts and weight matrices. So it's always weights[outcome][cue] and activations[outcome][event]
@Trybnetic i added also some changes, so please check them before merging. |
2 similar comments
@dekuenstle I have discussed it with @derNarr. He also argues to use outcomes as the first dimension of the activation matrix. I just did two small changes in the tests so we now use directly the matrix with the right dimensions instead of transposing the old ones |
1 similar comment
Before merging we should check that the examples are still working! Due to the major changes in this PR I expect that they will not work anymore |
@derNarr @dekuenstle @sumny I could not find an example of activation in the docs, is this right? As activation is a quite useful function we should consider adding an example if there isn't one yet. But I'm not sure whether we should do this in this PR or in an extra one in which we enhance the docs in general. What do you think? |
@Trybnetic Better an extra issure + PR for extending docs with activation estimation. |
@dekuenstle I agree with you. I've made todo note in #5 as this issue is mostly about documentation and examples. |
activation was not forced to take the correct weight dimensions.
This PR fixes this and makes the dimensions of weights consistent in pyndl