|
23 | 23 |
|
24 | 24 | sys.path.append("../fedgraph") |
25 | 25 | sys.path.append("../../") |
26 | | -from fedgraph.data_process_gc import * |
| 26 | +from fedgraph.data_process import data_loader_GC |
27 | 27 | from fedgraph.federated_methods import ( |
28 | 28 | run_GC_fedavg, |
29 | 29 | run_GC_fedprox, |
|
113 | 113 | # Here we prepare the data for the experiment. |
114 | 114 | # The data is split into training and test sets, and then the training set |
115 | 115 | # is further split into training and validation sets. |
116 | | -# The statistics of the data on trainers are also computed and saved. |
117 | 116 | # The user can also use their own dataset and dataloader. |
118 | 117 | # The expected format of the dataset is a dictionary with the keys as the trainer names. |
119 | 118 | # For each trainer, the value `data[trainer]` is a tuple with 4 elements: (dataloader, num_node_features, num_graph_labels, train_size) |
|
126 | 125 | """ using original features """ |
127 | 126 | print("Preparing data (original features) ...") |
128 | 127 |
|
129 | | -if args.is_multiple_dataset: |
130 | | - splited_data, df_stats = load_multiple_datasets( |
131 | | - datapath=args.datapath, |
132 | | - dataset_group=args.dataset, |
133 | | - batch_size=args.batch_size, |
134 | | - convert_x=args.convert_x, |
135 | | - seed=seed_split_data, |
136 | | - ) |
137 | | -else: |
138 | | - splited_data, df_stats = load_single_dataset( |
139 | | - args.datapath, |
140 | | - args.dataset, |
141 | | - num_trainer=args.num_trainers, |
142 | | - batch_size=args.batch_size, |
143 | | - convert_x=args.convert_x, |
144 | | - seed=seed_split_data, |
145 | | - overlap=args.overlap, |
146 | | - ) |
| 128 | +splited_data = data_loader_GC(args) |
147 | 129 | print("Data prepared.") |
148 | 130 |
|
149 | | -if args.save_files: |
150 | | - outdir_stats = os.path.join(outdir, f"stats_train_data.csv") |
151 | | - df_stats.to_csv(outdir_stats) |
152 | | - print(f"The statistics of the data are written to {outdir_stats}") |
153 | | - |
154 | | - |
155 | 131 | ####################################################################### |
156 | 132 | # Setup server and trainers |
157 | 133 | # ------------ |
|
0 commit comments