Skip to content

Commit

Permalink
Merge pull request #1588 from FedML-AI/raphael/fix-fediot
Browse files Browse the repository at this point in the history
[FedIot] Fix Test Method Bug
  • Loading branch information
Raphael-Jin authored Nov 9, 2023
2 parents e088f00 + 810510d commit c4794a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ train_args:
weight_decay: 0.001

validation_args:
frequency_of_the_test: 5
frequency_of_the_test: 1

device_args:
worker_num: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import numpy as np
import pandas as pd
import torch
import fedml
from torch import nn

from fedml.core import ServerAggregator
Expand All @@ -20,7 +21,7 @@ def set_model_params(self, model_parameters):
def test(self, test_data, device, args):
pass

def test_on_the_server(
def test_all(
self, train_data_local_dict, test_data_local_dict, device, args=None
) -> bool:
model = self.model
Expand Down Expand Up @@ -67,6 +68,9 @@ def test_on_the_server(
logging.info("The True positive number is {}".format(true_positive))
logging.info("The False negative number is {}".format(false_negative))

logging.info(f"The type of auc is {type(accuracy)}")
fedml.mlops.log({"round_idx": args.round_idx, "accuracy": float(accuracy)})

logging.info("The accuracy is {}".format(accuracy))
logging.info("The precision is {}".format(precision))
logging.info("The false positive rate is {}".format(false_positive_rate))
Expand Down

0 comments on commit c4794a0

Please sign in to comment.