non_delayed_index = index_collection[:usual_node_NUMBER] print('non_delayed_index') print(len(non_delayed_index)) delayed_index=index_collection[usual_node_NUMBER:usual_node_NUMBER+delayed_node_NUMBER] delayed_speed=delayed_SPEED print('delayed_index') print(len(delayed_index)) shared_index=index_collection[usual_node_NUMBER+delayed_node_NUMBER:usual_node_NUMBER+delayed_node_NUMBER+shared_node_NUMBER] print('shared_index') print(len(shared_index)) # initialize train = Fed_Training(model,non_delayed_index,central_weight_path,x_test, y_test,batch_size=50,augument=my_AUGUMENT,local_iid=local_IID,node_evl=node_EVL) train.load_test_set() # set bad nodes if bad_NODE: if bad_node_nb!=0: if bad_node_size!=0: bad_success = train.set_bad_node(bad_node_nb,bad_node_size) print('if bad_node assigned?') print(str(bad_success)) # set delayed index if delayed_index!=[]: train.set_delayed_update(delayed_index,delayed_speed) # set shared index
delayed_node_NUMBER] delayed_speed = delayed_SPEED print('delayed_index') print(len(delayed_index)) shared_index = index_collection[usual_node_NUMBER + delayed_node_NUMBER:usual_node_NUMBER + delayed_node_NUMBER + shared_node_NUMBER] print('shared_index') print(len(shared_index)) # initialize train = Fed_Training(model, non_delayed_index, central_weight_path, x_test, y_test, batch_size=50, augument=False) train.load_test_set() # set delayed index if delayed_index != []: train.set_delayed_update(delayed_index, delayed_speed) # set shared index if shared_index != []: train.set_shared_index(shared_index) # do training epo_h, loss_h, acc_h = train.fit(epo, patience, local_epoch=loc_epoch)