Skip to content

Fix pairwise inference task index selection#505

Open
SergeiNikolenko wants to merge 3 commits intoOpenADMET:mainfrom
SergeiNikolenko:fix/inference-pairwise-variable-j
Open

Fix pairwise inference task index selection#505
SergeiNikolenko wants to merge 3 commits intoOpenADMET:mainfrom
SergeiNikolenko:fix/inference-pairwise-variable-j

Conversation

@SergeiNikolenko
Copy link
Copy Markdown
Contributor

@SergeiNikolenko SergeiNikolenko commented Mar 4, 2026

Description

Fix pairwise inference dataframe generation to use explicit task index selection (task_idx) and add regression tests for single-task and multitask pairwise paths.

Status

  • Ready to go

Developers certificate of origin

SergeiNikolenko and others added 3 commits February 26, 2026 22:52
The variable j in _generate_pairwise_df was the leaked loop variable
from the list comprehension [smiles[j] for i, j in pairs], not the
intended task index. This caused predictions to always use the wrong
column. Add an explicit task_idx parameter and pass it from the caller
where j is the proper enumerate index over tasknames.

Signed-off-by: Nikolenko.Sergei <Nikolenko.Sergei@icloud.com>
@SergeiNikolenko
Copy link
Copy Markdown
Contributor Author

Closing per author request during fork cleanup/reset.

@SergeiNikolenko SergeiNikolenko deleted the fix/inference-pairwise-variable-j branch March 4, 2026 07:56
@SergeiNikolenko SergeiNikolenko restored the fix/inference-pairwise-variable-j branch March 4, 2026 08:01
@hmacdope
Copy link
Copy Markdown
Contributor

@SergeiNikolenko does this have a specific task that is not working or issue that this is associated with? I wasn't aware that anything was wrong.

@SergeiNikolenko
Copy link
Copy Markdown
Contributor Author

Hi, yes, this is fixing a real bug in the pairwise inference path.

Before this change, _generate_pairwise_df was using predictions[:, j], where j came from the generated pair (i, j) rather than from the task index. That means the selected prediction column depended on the pair indices instead of the output task.

In practice, that could lead to two problems:

  1. for multitask pairwise inference, predictions could be written from the wrong output column;
  2. for single-task pairwise inference, this could hit an out-of-bounds column index depending on the generated pairs.

I added tests covering both the task index selection and the pairwise inference path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants