@@ -184,11 +184,13 @@ def gen_benchmark_from_file(benchmark:str, config_file:str, target_path='.',data
184
184
if task_type == 'classification' :
185
185
temp_path = os .path .join (flgo .benchmark .path , 'toolkits' , 'cv' , 'classification' , 'temp' )
186
186
shutil .copytree (temp_path , bmk_path )
187
+ else :
188
+ raise NotImplementedError ('FLGo currently only support automatically generate cv.classification task. More other types are comming soon...' )
187
189
shutil .copyfile (config_file , os .path .join (bmk_path , 'config.py' ))
188
190
bmk_module = '.' .join (os .path .relpath (bmk_path , os .getcwd ()).split (os .path .sep ))
189
191
return bmk_module
190
192
191
- def gen_task_by_para (benchmark , bmk_para :dict = {}, Partitioner = None , par_para :dict = {}, task_path : str = '' , rawdata_path :str = '' , seed :int = 0 ):
193
+ def gen_task_from_para (benchmark , bmk_para :dict = {}, Partitioner = None , par_para :dict = {}, task_path : str = '' , rawdata_path :str = '' , seed :int = 0 ):
192
194
r"""
193
195
Generate a federated task according to the parameters of this function. The formats and meanings of the inputs are listed as below:
194
196
@@ -207,9 +209,9 @@ def gen_task_by_para(benchmark, bmk_para:dict={}, Partitioner=None, par_para:dic
207
209
>>> import flgo.benchmark.mnist_classification as mnist
208
210
>>> from flgo.benchmark.toolkits.partition import IIDPartitioner
209
211
>>> # GENERATE TASK BY PASSING THE MODULE OF BENCHMARK AND THE CLASS OF THE PARTITIOENR
210
- >>> flgo.gen_task_by_para (benchmark=mnist, Partitioner = IIDPartitioner, par_para={'num_clients':100}, task_path='./mnist_gen_by_para1')
212
+ >>> flgo.gen_task_from_para (benchmark=mnist, Partitioner = IIDPartitioner, par_para={'num_clients':100}, task_path='./mnist_gen_by_para1')
211
213
>>> # GENERATE THE SAME TASK BY PASSING THE STRING
212
- >>> flgo.gen_task_by_para (benchmark='flgo.benchmark.mnist_classification', Partitioner='IIDPartitioner', par_para={'num_clients':100}, task_path='./mnist_gen_by_para2')
214
+ >>> flgo.gen_task_from_para (benchmark='flgo.benchmark.mnist_classification', Partitioner='IIDPartitioner', par_para={'num_clients':100}, task_path='./mnist_gen_by_para2')
213
215
```
214
216
"""
215
217
random .seed (3 + seed )
0 commit comments