mirror of
https://github.com/IBM/ai-privacy-toolkit.git
synced 2026-07-23 17:01:03 +02:00
Tests and support for additional model output types
Signed-off-by: abigailt <abigailt@il.ibm.com>
This commit is contained in:
parent
a8ec87f922
commit
0f5a1bcaa0
2 changed files with 20 additions and 1 deletions
|
|
@ -227,6 +227,8 @@ class Model(metaclass=ABCMeta):
|
|||
count += np.count_nonzero(np.argmax(y[:, i], axis=1) == np.argmax(predicted[:, i], axis=1))
|
||||
sum += predicted.shape[0] * predicted.shape[-1]
|
||||
return count / sum
|
||||
elif self.output_type == ModelOutputType.CLASSIFIER_MULTI_OUTPUT_CATEGORICAL:
|
||||
return np.count_nonzero(y == predicted) / (predicted.shape[0] * y.shape[1])
|
||||
elif is_binary(self.output_type):
|
||||
if is_logits(self.output_type):
|
||||
if apply_non_linearity:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue