代码拉取完成,页面将自动刷新
import json
def get_dyna_config():
with open("dynamic_config.json", "r") as fi:
ret = json.load(fi)
return ret
def set_dyna_config(conf):
with open("dynamic_config.json", "w") as fo:
fo.write(json.dumps(conf))
key = bytes(range(16))
init_model_path = "init_model.pt"
client_final_model_path = "client_final_model.pt"
single_final_model_path = "single_final_model.pt"
server_addr_path = "clientips"
server_weight_path = "AggregationWeight"
def coor_addr_path(serverip): return f"clientips/{serverip}"
# There is expected to be a meta file which instructs the path of each param
# Each file is named by model.state_dict().keys()
client_param_dir = "param"
client_param_tar_path = "param.tar"
client_mask_dir = "mask"
client_mask_tar_path = "mask.tar"
def coor_mask_dir(clientip): return f"mask/{clientip}"
def coor_mask_tar_path(clientip): return f"mask/{clientip}.tar"
def server_param_dir(ip): return f"param/{ip}"
def server_param_tar_path(ip): return f"param/{ip}.tar"
server_aggregated_param_dir = "param0"
server_aggregated_param_tar_path = "param0.tar"
def coor_aggregated_mask_dir(serverip): return f"mask{serverip}"
def coor_aggregated_mask_tar_path(serverip): return f"mask{serverip}.tar"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。