Repository navigation
Missing labels in loss kwargs causing issue for electra model / Issues from PR#130 #140
Description
Activity
Also, the
pass_loss_kwargsfor electra was set toTrueinstead of accepting value from the user or method parameter. Is there any particular reason for it with new changes introduced ?
https://github.com/ChEB-AI/python-chebai/pull/130/files#diff-9b4cba0f4cb875af21676f1998e61cd7b25a1e65d7b971a00ce88d17df880706R244Also in electra config, the model type is set to
regression, shouldn't it be the original classification version by default.Also, I wonder whether the issue #53 was also addressed in that PR. As I see files and tests related to tox changed.
Default beta value for BCE is set to 1000
Is this was the intended change ?
I wonder why the following line as deleted ?
https://github.com/ChEB-AI/python-chebai/pull/130/files#diff-5a15c77150d45ed1d4be890d0dc4808bfc54d5df4a9a998ddedf9ab583d7c3c3L276The reason for this question is that I am concerned that deletion and the below error might be related.
https://wandb.ai/chebai/chebai/runs/m74gxlm8/logs?nw=nwuseraditya0by0SLURM auto-requeueing enabled. Setting signal handlers. Sanity Checking: | | 0/? [00:00<?, ?it/s] Loading validation data... (datamodule.current_epoch=N/A) Loading splits from data/chebi_v241/ChEBI50/processed/splits.csv... Sanity Checking DataLoader 0: 0%| | 0/2 [00:00<?, ?it/s]Computing loss-weights based on v241 dataset (beta=1000.0) Epoch 0: 100%|██████████| 5017/5017 [02:25<00:00, 34.43it/s, v_num=0153, train_loss_step=nan.0, val_loss_step=nan.0, val_loss_epoch=nan.0, val_macro-f1=0.000, val_micro-f1=0.000, train_loss_epoch=nan.0, train_macro-f1=2.62e-5, train_micro-f1=0.000748] Loading train data... (datamodule.current_epoch=N/A) Starting epoch 0 Traceback (most recent call last): File "/home/staff/a/akhedekar/miniconda3/envs/gnn/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/staff/a/akhedekar/miniconda3/envs/gnn/lib/python3.10/runpy.py", line 86, in _run_code ... ... ... File "/home/staff/a/akhedekar/miniconda3/envs/gnn/lib/python3.10/site-packages/lightning/pytorch/callbacks/model_checkpoint.py", line 383, in _save_topk_checkpoint raise MisconfigurationException(m) lightning.fabric.utilities.exceptions.MisconfigurationException: `ModelCheckpoint(monitor='val_roc-auc')` could not find the monitored key in the returned metrics: ['train_loss', 'train_loss_step', 'val_loss', 'val_loss_epoch', 'val_macro-f1', 'val_micro-f1', 'train_loss_epoch', 'train_macro-f1', 'train_micro-f1', 'epoch', 'step']. HINT: Did you call `log('val_roc-auc', value)` in the `LightningModule`?
- changed the title
[-]Missing labels in loss kwargs causing issue for electra model[/-][+]Missing labels in loss kwargs causing issue for electra model / Issue from PR#130[/+]on Jan 11, 2026 - changed the title
[-]Missing labels in loss kwargs causing issue for electra model / Issue from PR#130[/-][+]Missing labels in loss kwargs causing issue for electra model / Issues from PR#130[/+]on Jan 11, 2026 Oh dear, it seems like we missed some important things in PR #130.
Also, the
pass_loss_kwargsfor electra was set toTrueinstead of accepting value from the user or method parameter. Is there any particular reason for it with new changes introduced ?
https://github.com/ChEB-AI/python-chebai/pull/130/files#diff-9b4cba0f4cb875af21676f1998e61cd7b25a1e65d7b971a00ce88d17df880706R244That does not make sense. True is already the default and I don't see a reason for overriding the user input. We should remove that line.
Also in electra config, the model type is set to regression, shouldn't it be the original classification version by default.
You are right, it should be classification.
Also, I wonder whether the issue #53 was also addressed in that PR. As I see files and tests related to tox changed.
Probably, that is a question for @schnamo
Default beta value for BCE is set to 1000
Is this was the intended change ?
I would say not intended since beta is supposed to be a value between 0 and 1, we should ask @schnamo about this (and also about the other BCE configs).
I wonder why the following line as deleted ? https://github.com/ChEB-AI/python-chebai/pull/130/files#diff-5a15c77150d45ed1d4be890d0dc4808bfc54d5df4a9a998ddedf9ab583d7c3c3L276
I don't know why it got removed, we should re-add it (although I'm not sure if that solves the problem you mention).
For the loss configs, see also #139
- pass_loss_kwargs always set to True removed
- electra config set to classification
- loss configs tidied up
- BCE loss beta parameter set to 0.99 in accordance with Chebifier
- Re-added accidentally removed line
Seems to work fine now!
When I try use an electra checkpoint for prediction, the recently merged code in the PR #130 causes an issue.
Additional Information
shape of missing labels is
[2, 2]with following values.
[[False, False], [False, False]]the missing labels are added using collator with new logic (#130). Relevant part of code below: