Advertisement
john99nguyen

Untitled

Aug 11th, 2022
1,027
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. for t in range(num_rounds):
  2.     clients = sample_clients(cohort_size)
  3.     client_features = features(clients)
  4.     configs = linear_model(client_features)
  5.    
  6.     round_grads, client_evals = [], []
  7.     for config, client in zip(configs, client):
  8.         delta, client_eval_loss = client.train(config, global_model)
  9.         round_grads.append(delta)
  10.         client_evals.append(client_eval_loss)
  11.  
  12.     global_model = server.step(average(round_grads))    
  13.     linear_model = optimize(linear_model, client_evals, configs)
  14.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement