Testing utils
compute_biobert_loss_singlegpu(trainer, pl_module)
Computes the loss for BioBert models on a single GPU.
This will not function in multi-gpu settings nor with models that do not conform to BioBert.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
trainer
|
Trainer
|
The Lightning Trainer object. |
required |
pl_module
|
LightningModule
|
The LightningModule being trained. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
The mean loss. |
See Also: - :class: BioBertModel
Source code in bionemo/llm/model/biobert/testing_utils.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|