SiaNet/Metrics/BinaryAccuracy.cs
/// <summary>
/// Calculates the metric with predicted and true values.
/// </summary>
/// <param name="preds">The predicted value.</param>
/// <param name="labels">The true value.</param>
/// <returns></returns>
Calculates the metric with predicted and true values.
Calculates the metric with predicted and true values .
public override Tensor Calc(Tensor preds, Tensor labels)
        {
            preds = K.Clip(preds, 0, 1);
            var r = K.EqualTo(K.Round(preds), labels);
            return r;
        }
public override Tensor Calc ( Tensor preds , Tensor labels ) { preds = K . Clip ( preds , 0 , 1 ) ; var r = K . EqualTo ( K . Round ( preds ) , labels ) ; return r ; }
Calculates the metric with predicted and true values.
Calculates the metric with predicted and true values .
None
preds
Tensor
The predicted value.
The predicted value .
labels
Tensor
The true value.
The true value .