From 0d0ebee9c0f9e340e047984340994f414931ecad Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Sun, 12 Apr 2020 04:50:54 -0500 Subject: [PATCH] bug fix with autopilot/drone mode --- pipeline.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pipeline.py b/pipeline.py index e54e746..22c637d 100644 --- a/pipeline.py +++ b/pipeline.py @@ -74,6 +74,13 @@ class Components : # pointer = args['reader'] if 'reader' in args else lambda: Components.get(**args) df = args['data'] + if 'slice' in args and 'max_rows' in args['slice']: + max_rows = args['slice']['max_rows'] + if df.shape[0] > max_rows : + print (".. slicing ") + i = np.random.choice(df.shape[0],max_rows,replace=False) + df = df.iloc[i] + # if df.shape[0] == 0 : # print ("CAN NOT TRAIN EMPTY DATASET ") @@ -117,9 +124,10 @@ class Components : logger.write({"module":"train","action":"train","input":info}) data.maker.train(**_args) + if set(['drone','autopilot']) in set( list(args.keys())) : print (['drone mode enabled ....']) - data.maker.generate(**args) + self.generate(**args) pass @@ -155,6 +163,7 @@ class Components : # reader = args['reader'] # df = reader() df = args['reader']() if 'reader' in args else args['data'] + # bounds = Components.split(df,MAX_ROWS,PART_SIZE) # if partition != '' :