diff --git a/CHANGELOG.md b/CHANGELOG.md index bbb5306e..61b35d1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/iblrig/__init__.py b/iblrig/__init__.py index 08d92fda..284995df 100644 --- a/iblrig/__init__.py +++ b/iblrig/__init__.py @@ -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 diff --git a/iblrig/base_choice_world.py b/iblrig/base_choice_world.py index 0e03f07c..2bfa6c22 100644 --- a/iblrig/base_choice_world.py +++ b/iblrig/base_choice_world.py @@ -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 @@ -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