Skip to content

Commit

Permalink
Merge pull request #734 from int-brain-lab/iblrigv8dev
Browse files Browse the repository at this point in the history
fix debiasing
  • Loading branch information
bimac authored Oct 24, 2024
2 parents 0e0bc83 + 90cc171 commit 6671d7b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

8.24.7
------
* fix: debiasing not working in trainingCW

8.24.6
------
* add property getters for feedback delays (for NM custom task)
Expand Down
2 changes: 1 addition & 1 deletion iblrig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 5) git tag the release in accordance to the version number below (after merge!)
# >>> git tag 8.15.6
# >>> git push origin --tags
__version__ = '8.24.6'
__version__ = '8.24.7'


from iblrig.version_management import get_detailed_version_string
Expand Down
5 changes: 4 additions & 1 deletion iblrig/base_choice_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,9 @@ def next_trial(self):
do_debias_trial = (self.trials_table.loc[self.trial_num - 1, 'trial_correct'] != 1) and last_contrast >= 0.5
self.trials_table.at[self.trial_num, 'debias_trial'] = do_debias_trial
if do_debias_trial:
iresponse = self.trials_table['response_side'] != 0 # trials that had a response
iresponse = np.logical_and(
~self.trials_table['response_side'].isna(), self.trials_table['response_side'] != 0
) # trials that had a response
# takes the average of right responses over last 10 response trials
average_right = np.mean(self.trials_table['response_side'][iresponse[-np.maximum(10, iresponse.size) :]] == 1)
# the next probability of next stimulus being on the left is a draw from a normal distribution
Expand All @@ -1029,6 +1031,7 @@ def show_trial_log(self, extra_info: dict[str, Any] | None = None, log_level: in
info_dict = {
'Contrast Set': np.unique(np.abs(choiceworld.contrasts_set(self.training_phase))),
'Training Phase': self.training_phase,
'Debias Trial': self.trials_table.at[self.trial_num, 'debias_trial'],
}

# update info dict with extra_info dict
Expand Down

0 comments on commit 6671d7b

Please sign in to comment.