torchtraining.metrics.regression¶
-
class
torchtraining.metrics.regression.AbsoluteError(reduction=<built-in method mean of type object>)[source]¶ Absolute error between
outputsandtargets.- Parameters
reduction (Callable(torch.Tensor) -> Any, optional) – One argument callable getting
torch.Tensorand returning argument after specified reduction. Default:torch.mean(mean across batch, user can usetorchtraining.savers.Meanto get mean across iterations/epochs).
-
forward(data)[source]¶ - Parameters
data (Tuple[torch.Tensor, torch.Tensor]) – Tuple containing
outputsfrom neural network and regressiontargets.outputsshould be of shape , where is the number of samples. Should containfloatingpoint values.targetsshould be in the same shapeoutputsand be offloatdata type as well.- Returns
If
reductionis left as default mean is taken and single value returned. Otherwise whateverreductionreturns.- Return type
-
class
torchtraining.metrics.regression.AdjustedR2(p: int)[source]¶ Adjusted R2 score between
outputsandtargets.- Parameters
p (int) – Number of explanatory terms in model.
-
forward(data)[source]¶ - Parameters
data (Tuple[torch.Tensor, torch.Tensor]) – Tuple containing
outputsfrom neural network and regressiontargets.outputsshould be of shape , where is the number of samples. Should containfloatingpoint values.targetsshould be in the same shapeoutputsand be offloatdata type as well.- Returns
Scalar
tensor- Return type
-
class
torchtraining.metrics.regression.MaxError[source]¶ Maximum error between
outputsandtargets.-
forward(data)[source]¶ - Parameters
data (Tuple[torch.Tensor, torch.Tensor]) – Tuple containing
outputsfrom neural network and regressiontargets.outputsshould be of shape , where is the number of samples. Should containfloatingpoint values.targetsshould be in the same shapeoutputsand be offloatdata type as well.- Returns
Scalar
tensor- Return type
-
-
class
torchtraining.metrics.regression.R2[source]¶ R2 score between
outputsandtargets.-
forward(data)[source]¶ - Parameters
data (Tuple[torch.Tensor, torch.Tensor]) – Tuple containing
outputsfrom neural network and regressiontargets.outputsshould be of shape , where is the number of samples. Should containfloatingpoint values.targetsshould be in the same shapeoutputsand be offloatdata type as well.- Returns
Scalar
tensor- Return type
-
-
class
torchtraining.metrics.regression.RegressionOfSquares(reduction=<built-in method sum of type object>)[source]¶ Regression of squares between
outputsandtargets.- Parameters
reduction (Callable, optional) – One argument callable getting
torch.Tensorand returningtorch.Tensor. Default:torch.sum(sum of all elements, user can usetorchtraining.savers.Sumto get sum across iterations/epochs).
-
forward(data)[source]¶ - Parameters
data (Tuple[torch.Tensor, torch.Tensor]) – Tuple containing
outputsfrom neural network and regressiontargets.outputsshould be of shape , where is the number of samples. Should containfloatingpoint values.targetsshould be in the same shapeoutputsand be offloatdata type as well.- Returns
If
reductionis left as default sum is taken and single value returned. Otherwise whateverreductionreturns.- Return type
-
class
torchtraining.metrics.regression.SquaredError(reduction=<built-in method mean of type object>)[source]¶ Squared error between
outputsandtargets.- Parameters
reduction (Callable(torch.Tensor) -> Any, optional) – One argument callable getting
torch.Tensorand returning argument after specified reduction. Default:torch.mean(mean across batch, user can usetorchtraining.savers.Meanto get mean across iterations/epochs).
-
forward(data)[source]¶ - Parameters
data (Tuple[torch.Tensor, torch.Tensor]) – Tuple containing
outputsfrom neural network and regressiontargets.outputsshould be of shape , where is the number of samples. Should containfloatingpoint values.targetsshould be in the same shapeoutputsand be offloatdata type as well.- Returns
If
reductionis left as default mean is taken and single value returned. Otherwise whateverreductionreturns.- Return type
-
class
torchtraining.metrics.regression.SquaredLogError(reduction=<built-in method mean of type object>)[source]¶ Squared log error between
outputsandtargets.- Parameters
reduction (Callable(torch.Tensor) -> Any, optional) – One argument callable getting
torch.Tensorand returning argument after specified reduction. Default:torch.mean(mean across batch, user can usetorchtraining.savers.Meanto get mean across iterations/epochs).
-
forward(data)[source]¶ - Parameters
data (Tuple[torch.Tensor, torch.Tensor]) – Tuple containing
outputsfrom neural network and regressiontargets.outputsshould be of shape , where is the number of samples. Should containfloatingpoint values.targetsshould be in the same shapeoutputsand be offloatdata type as well.- Returns
If
reductionis left as default mean is taken and single value returned. Otherwise whateverreductionreturns.- Return type
-
class
torchtraining.metrics.regression.SquaresOfResiduals(reduction=<built-in method sum of type object>)[source]¶ Square of residuals between
outputsandtargets.- Parameters
reduction (Callable, optional) – One argument callable getting
torch.Tensorand returningtorch.Tensor. Default:torch.sum(sum of all elements, user can usetorchtraining.savers.Sumto get sum across iterations/epochs).
-
forward(data)[source]¶ - Parameters
data (Tuple[torch.Tensor, torch.Tensor]) – Tuple containing
outputsfrom neural network and regressiontargets.outputsshould be of shape , where is the number of samples. Should containfloatingpoint values.targetsshould be in the same shapeoutputsand be offloatdata type as well.- Returns
If
reductionis left as default sum is taken and single value returned. Otherwise whateverreductionreturns.- Return type
-
class
torchtraining.metrics.regression.TotalOfSquares(reduction=<built-in method sum of type object>)[source]¶ Total of squares of single
tensor.- Parameters
reduction (Callable, optional) – One argument callable getting
torch.Tensorand returningtorch.Tensor. Default:torch.sum(sum of all elements, user can usetorchtraining.savers.Sumto get sum across iterations/epochs).
-
forward(data)[source]¶ - Parameters
data (torch.Tensor) – Tensor containing
floatdata of any shape. Usuallytargets.- Returns
If
reductionis left as default {} is taken and single value returned. Otherwise whateverreductionreturns.- Return type