From 1ef4b1041ff4b2a1797bea17d84d58a5e7686686 Mon Sep 17 00:00:00 2001 From: joaopauloschuler Date: Thu, 28 Nov 2019 18:47:04 +0100 Subject: [PATCH] Adding EnableClassComparison() --- neural/neuralfit.pas | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/neural/neuralfit.pas b/neural/neuralfit.pas index 6abce7fc..21bd0006 100644 --- a/neural/neuralfit.pas +++ b/neural/neuralfit.pas @@ -147,6 +147,7 @@ TNeuralDataLoadingFit = class(TNeuralFitBase) Item: TMultiThreadProcItem); procedure EnableMonopolarHitComparison(); procedure EnableBipolarHitComparison(); + procedure EnableClassComparison(); property DataAugmentationFn: TNNetDataAugmentationFn read FDataAugmentationFn write FDataAugmentationFn; property InferHitFn: TNNetInferHitFn read FInferHitFn write FInferHitFn; @@ -207,6 +208,7 @@ TNeuralImageFit = class(TNeuralFitBase) function MonopolarCompare(A, B: TNNetVolume): boolean; function BipolarCompare(A, B: TNNetVolume): boolean; + function ClassCompare(A, B: TNNetVolume): boolean; implementation uses @@ -250,6 +252,10 @@ function BipolarCompare(A, B: TNNetVolume): boolean; end; end; +function ClassCompare(A, B: TNNetVolume): boolean; +begin + Result := (A.GetClass() = B.GetClass()); +end; { TNeuralDataLoadingFit } constructor TNeuralDataLoadingFit.Create(); @@ -884,6 +890,11 @@ procedure TNeuralDataLoadingFit.EnableBipolarHitComparison(); FInferHitFn := @BipolarCompare; end; +procedure TNeuralDataLoadingFit.EnableClassComparison(); +begin + FInferHitFn := @ClassCompare; +end; + { TNeuralFitBase } constructor TNeuralFitBase.Create();