def create_Partner(iterate_dataset_name): """Instantiate partner object""" part = Partner(partner_id=0) dataset_name = iterate_dataset_name if dataset_name == "cifar10": (x_train, y_train), (x_test, y_test) = cifar10.load_data() part.y_train = data_cf.preprocess_dataset_labels(y_train) if dataset_name == "mnist": (x_train, y_train), (x_test, y_test) = mnist.load_data() part.y_train = data_mn.preprocess_dataset_labels(y_train) yield part
def create_partners_list(dataset_name, partners_count): partners_list = [] for i in range(partners_count): part = Partner(partner_id=i) if dataset_name == "cifar10": (x_train, y_train), (x_test, y_test) = cifar10.load_data() part.y_train = data_cf.preprocess_dataset_labels(y_train) if dataset_name == "mnist": (x_train, y_train), (x_test, y_test) = mnist.load_data() part.y_train = data_mn.preprocess_dataset_labels(y_train) partners_list.append(part) return partners_list