code/federated/federated_learning.py
def sum_scaled_weights(scaled_weight_list):
    '''Return the sum of the listed scaled weights. The is equivalent to scaled avg of the weights'''
    print('scaled_weight_list',len(scaled_weight_list))
    avg_grad = list()
    #get the average grad accross all client gradients
    for grad_list_tuple in zip(*scaled_weight_list):
        layer_mean = tf.math.reduce_sum(grad_list_tuple, axis=0)/len(scaled_weight_list)
        avg_grad.append(layer_mean)
    return avg_grad
Return the sum of the listed scaled weights. The is equivalent to scaled avg of the weights
Return the sum of the listed scaled weights. The is equivalent to scaled avg of the weights
Return the sum of the listed scaled weights . The is equivalent to scaled avg of the weights
def sum_scaled_weights(scaled_weight_list):
    print('scaled_weight_list',len(scaled_weight_list))
    avg_grad = list()
    for grad_list_tuple in zip(*scaled_weight_list):
        layer_mean = tf.math.reduce_sum(grad_list_tuple, axis=0)/len(scaled_weight_list)
        avg_grad.append(layer_mean)
    return avg_grad
def sum_scaled_weights ( scaled_weight_list ) : print ( 'scaled_weight_list' , len ( scaled_weight_list ) ) avg_grad = list ( ) for grad_list_tuple in zip ( * scaled_weight_list ) : layer_mean = tf . math . reduce_sum ( grad_list_tuple , axis = 0 ) / len ( scaled_weight_list ) avg_grad . append ( layer_mean ) return avg_grad
Return the sum of the listed scaled weights.
Return the sum of the listed scaled weights .
'''Return the sum of the listed scaled weights. The is equivalent to scaled avg of the weights''' #get the average grad accross all client gradients
scaled_weight_list