metrics
Module for metrics calculation.
Functions:
| Name | Description |
|---|---|
percentage_changed_ids |
Compute the percentage of token ids that differ between |
percentage_changed_ids
¶
percentage_changed_ids(
input_ids: Tensor,
reconstructed_ids: Tensor,
noise_mask: Tensor,
) -> torch.Tensor
Compute the percentage of token ids that differ between input_ids and reconstructed_ids.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Tensor
|
The original token ids. |
required |
|
Tensor
|
The token ids reconstructed from the transformed embeddings of |
required |
|
Tensor
|
The mask that selects the elements of |
required |
Returns:
| Type | Description |
|---|---|
torch.Tensor
|
The percentage of token ids that differ between |
torch.Tensor
|
|
Examples: