Skip to content

Commit

Permalink
Override WeightsMetrics equality members
Browse files Browse the repository at this point in the history
  • Loading branch information
Neakita committed Mar 2, 2024
1 parent 600ea6f commit 84e2e14
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions SightKeeper.Domain.Model/DataSets/Weights/WeightsMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,20 @@ public WeightsMetrics(uint epoch, float boundingLoss, float classificationLoss,
DeformationLoss = deformationLoss;
}

public bool Equals(WeightsMetrics other)
{
return Epoch == other.Epoch && BoundingLoss.Equals(other.BoundingLoss) && ClassificationLoss.Equals(other.ClassificationLoss) && DeformationLoss.Equals(other.DeformationLoss);
}

public override bool Equals(object? obj)
{
return obj is WeightsMetrics other && Equals(other);
}

public override int GetHashCode()
{
return HashCode.Combine(Epoch, BoundingLoss, ClassificationLoss, DeformationLoss);
}

public override string ToString() => $"{nameof(Epoch)}: {Epoch}, {nameof(BoundingLoss)}: {BoundingLoss}, {nameof(ClassificationLoss)}: {ClassificationLoss}, {nameof(DeformationLoss)}: {DeformationLoss}";
}

0 comments on commit 84e2e14

Please sign in to comment.