代码拉取完成,页面将自动刷新
import datetime
import utils.csv_record as csv_record
import torch
import torch.nn as nn
import torch.nn.functional as F
import time
import main
import loan_train
import image_train
import config
import random
def train(helper, start_epoch, local_model, target_model, is_poison,agent_name_keys):
epochs_submit_update_dict={}
num_samples_dict={}
if helper.params['type'] == config.TYPE_LOAN:
epochs_submit_update_dict, num_samples_dict = loan_train.LoanTrain(helper, start_epoch, local_model, target_model, is_poison,agent_name_keys)
elif helper.params['type'] == config.TYPE_CIFAR \
or helper.params['type'] == config.TYPE_MNIST \
or helper.params['type']==config.TYPE_TINYIMAGENET:
epochs_submit_update_dict, num_samples_dict = image_train.ImageTrain(helper, start_epoch, local_model,
target_model, is_poison, agent_name_keys)
return epochs_submit_update_dict, num_samples_dict
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。