torchmetrics
Modules:
| Name | Description | 
|---|---|
| quantile |  | 
| table |  | 
Classes:
| Name | Description | 
|---|---|
| QuantileMetric | Computes quantiles over a set of observations. | 
| TableMetric | Synchronizes the state of a  | 
    
              Bases: CatMetric
Computes quantiles over a set of observations.
Methods:
| Name | Description | 
|---|---|
| __init__ | Construct a  | 
| compute | Aggregate the observations and compute the configured quantiles. | 
Attributes:
| Name | Type | Description | 
|---|---|---|
| dtype | dtype | The  | 
property
  
¶
dtype: dtype
The torch.dtype that each update value will be cast to and thereby the torch.dtype of the compute result also.
torch.quantile requires the q tensor to have same dtype as the input tensor (the compute result) and both must be either
float32 or float64.
__init__(
    q: float | Iterable[float] | Tensor,
    interpolation: Literal[
        "linear", "lower", "higher", "nearest", "midpoint"
    ]
    | str = "linear",
    nan_strategy: Literal[
        "error", "warn", "ignore", "disable"
    ]
    | float = "warn",
    **kwargs: Any,
) -> None
Construct a QuantileMetric.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
|                    | float | Iterable[float] | Tensor | The quantiles to compute. Values should be in the range [0, 1]. Should be a tensor, or a list or tuple of  | required | 
|                    | Literal['linear', 'lower', 'higher', 'nearest', 'midpoint'] | str | One of:
*  | 'linear' | 
|                    | Literal['error', 'warn', 'ignore', 'disable'] | float | One of:
*  | 'warn' | 
|                    | Any | Additional arguments to pass to the base metric class. | required | 
    Aggregate the observations and compute the configured quantiles.
Returns:
| Type | Description | 
|---|---|
| tuple[torch.Tensor, dict[float, torch.Tensor]] | The observations and a mapping of quantiles to their corresponding value. | 
    
              Bases: Metric
Synchronizes the state of a dict[str, list[Any]] across multiple worker processes.
Methods:
| Name | Description | 
|---|---|
| __init__ | Construct a  | 
| __len__ | Return the number of rows in the aggregated table. | 
| compute | Return the aggregated table. | 
| reset | Reset the aggregated table. | 
| update | Aggregate the incoming update from all workers processes and share it with all other worker processes. | 
    Return the aggregated table.
Raises:
| Type | Description | 
|---|---|
| ValueError | If no updates have been performed yet. | 
Returns:
| Type | Description | 
|---|---|
| dict[str, list[Any]] | The aggregated table. | 
    Aggregate the incoming update from all workers processes and share it with all other worker processes.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
|                    | dict[str, list[Any]] | Additional rows to add to the aggregated table. | required | 
Raises:
| Type | Description | 
|---|---|
| ValueError | If the table update has no columns. | 
| ValueError | If the table update's keys does not match the aggregated table's keys. | 
| ValueError | If the table update's values are not lists. | 
| ValueError | If the table update's lists are not all of equal length. | 
| ValueError | If the table update has no rows. |