(self, num_epochs=1, batch_size=10, minibatch=None, clients=None)
return sys_metrics
Trains self.model on given clients.
        
        Trains model on self.selected_clients if clients=None;
        each client's data is trained with the given number of epochs
        and batches.

        Args:
            clients: list of Client objects.
            num_epochs: Number of epochs to train.
            batch_size: Size of training batches.
            minibatch: fraction of client's data to apply minibatch sgd,
                None to use FedAvg
        Return:
            bytes_written: number of bytes written by each client to server 
                dictionary with client ids as keys and integer values.
            client computations: number of FLOPs computed by each client
                dictionary with client ids as keys and integer values.
            bytes_read: number of bytes read by each client from server
                dictionary with client ids as keys and integer values.
Trains self.model on given clients.
        
        Trains model on self.selected_clients if clients=None;
        each client's data is trained with the given number of epochs
        and batches.
Trains self . model on given clients . Trains model on self . selected_clients if clients = None ; each client s data is trained with the given number of epochs and batches .
def train_model(self, num_epochs=1, batch_size=10, minibatch=None, clients=None):
        """Trains self.model on given clients.
        
        Trains model on self.selected_clients if clients=None;
        each client's data is trained with the given number of epochs
        and batches.

        Args:
            clients: list of Client objects.
            num_epochs: Number of epochs to train.
            batch_size: Size of training batches.
            minibatch: fraction of client's data to apply minibatch sgd,
                None to use FedAvg
        Return:
            bytes_written: number of bytes written by each client to server 
                dictionary with client ids as keys and integer values.
            client computations: number of FLOPs computed by each client
                dictionary with client ids as keys and integer values.
            bytes_read: number of bytes read by each client from server
                dictionary with client ids as keys and integer values.
        """
        if clients is None:
            clients = self.selected_clients
        sys_metrics = {
            c.id: {BYTES_WRITTEN_KEY: 0,
                   BYTES_READ_KEY: 0,
                   LOCAL_COMPUTATIONS_KEY: 0} for c in clients}
        for c in clients:
            c.model.set_params(self.model)
            comp, num_samples, update = c.train(num_epochs, batch_size, minibatch)

            sys_metrics[c.id][BYTES_READ_KEY] += c.model.size
            sys_metrics[c.id][BYTES_WRITTEN_KEY] += c.model.size
            sys_metrics[c.id][LOCAL_COMPUTATIONS_KEY] = comp

            self.updates.append((num_samples, update))

        return sys_metrics
def train_model ( self , num_epochs = 1 , batch_size = 10 , minibatch = None , clients = None ) : if clients is None : clients = self . selected_clients sys_metrics = { c . id : { BYTES_WRITTEN_KEY : 0 , BYTES_READ_KEY : 0 , LOCAL_COMPUTATIONS_KEY : 0 } for c in clients } for c in clients : c . model . set_params ( self . model ) comp , num_samples , update = c . train ( num_epochs , batch_size , minibatch ) sys_metrics [ c . id ] [ BYTES_READ_KEY ] += c . model . size sys_metrics [ c . id ] [ BYTES_WRITTEN_KEY ] += c . model . size sys_metrics [ c . id ] [ LOCAL_COMPUTATIONS_KEY ] = comp self . updates . append ( ( num_samples , update ) ) return sys_metrics