accuracy
shrinkai.profiler.accuracy
Functions:
| Name | Description |
|---|---|
compute_accuracy |
Computes the accuracy of a model over a validation dataloader. |
Functions:
compute_accuracy
Computes the accuracy of a model over a validation dataloader.
Handles both 2D logits (classification) and 3D logits (causal language modeling).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Module
|
The standard PyTorch model. |
required |
dataloader
|
DataLoader
|
Dataloader for evaluation after each epoch. |
required |
device
|
str | device
|
Computing target ('auto', 'mps', 'cuda', 'cpu' or torch.device) |
required |
Returns: float: Model's accuracy.