@ -67,8 +67,9 @@ class GNet :
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        self . NUM_GPUS  =  0 
 
					 
					 
					 
					                        self . NUM_GPUS  =  0 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                else : 
 
					 
					 
					 
					                else : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        self . NUM_GPUS  =  len ( self . GPU_CHIPS ) 
 
					 
					 
					 
					                        self . NUM_GPUS  =  len ( self . GPU_CHIPS ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                        # os.environ['CUDA_VISIBLE_DEVICES'] = str(self.GPU_CHIPS[0]) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                
 
					 
					 
					 
					                
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                self . PARTITION  =  args [ ' partition ' ] 
 
					 
					 
					 
					                self . PARTITION  =  args [ ' partition ' ]  if  ' partition '  in  args  else  None  
 
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					                # if self.NUM_GPUS > 1 : 
 
					 
					 
					 
					                # if self.NUM_GPUS > 1 : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                #     os.environ['CUDA_VISIBLE_DEVICES'] = "4" 
 
					 
					 
					 
					                #     os.environ['CUDA_VISIBLE_DEVICES'] = "4" 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -117,9 +118,14 @@ class GNet :
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                for  key  in  [ ' train ' , ' output ' ]  : 
 
					 
					 
					 
					                for  key  in  [ ' train ' , ' output ' ]  : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        self . mkdir ( os . sep . join ( [ self . log_dir , key ] ) ) 
 
					 
					 
					 
					                        self . mkdir ( os . sep . join ( [ self . log_dir , key ] ) ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        self . mkdir  ( os . sep . join ( [ self . log_dir , key , self . CONTEXT ] ) ) 
 
					 
					 
					 
					                        self . mkdir  ( os . sep . join ( [ self . log_dir , key , self . CONTEXT ] ) ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                        if  ' partition '  in  args  : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                                self . mkdir  ( os . sep . join ( [ self . log_dir , key , self . CONTEXT , str ( args [ ' partition ' ] ) ] ) ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        
 
					 
					 
					 
					                        
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                self . train_dir   =  os . sep . join ( [ self . log_dir , ' train ' , self . CONTEXT ] )                 
 
					 
					 
					 
					                self . train_dir   =  os . sep . join ( [ self . log_dir , ' train ' , self . CONTEXT ] )                 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                self . out_dir  =  os . sep . join ( [ self . log_dir , ' output ' , self . CONTEXT ] ) 
 
					 
					 
					 
					                self . out_dir  =  os . sep . join ( [ self . log_dir , ' output ' , self . CONTEXT ] ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                if  ' partition '  in  args  : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                        self . train_dir  =  os . sep . join ( [ self . train_dir , str ( args [ ' partition ' ] ) ] ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                        self . out_dir  =  os . sep . join ( [ self . out_dir , str ( args [ ' partition ' ] ) ] ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                # if self.logger : 
 
					 
					 
					 
					                # if self.logger : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        
 
					 
					 
					 
					                        
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                #         We will clear the logs from the data-store  
 
					 
					 
					 
					                #         We will clear the logs from the data-store  
 
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -130,7 +136,7 @@ class GNet :
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                #                 db.backup.insert({'name':column,'logs':list(db[column].find()) }) 
 
					 
					 
					 
					                #                 db.backup.insert({'name':column,'logs':list(db[column].find()) }) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                #                 db[column].drop() 
 
					 
					 
					 
					                #                 db[column].drop() 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                
 
					 
					 
					 
					                
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        def  load_meta ( self , column ) : 
 
					 
					 
					 
					        def  load_meta ( self , * * args ) : 
 
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					                """ 
 
					 
					 
					 
					                """ 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                This  function  is  designed  to  accomodate  the  uses  of  the  sub - classes  outside  of  a  strict  dependency  model . 
 
					 
					 
					 
					                This  function  is  designed  to  accomodate  the  uses  of  the  sub - classes  outside  of  a  strict  dependency  model . 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                Because  prediction  and  training  can  happen  independently 
 
					 
					 
					 
					                Because  prediction  and  training  can  happen  independently 
 
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -145,6 +151,9 @@ class GNet :
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                setattr ( self , key , value ) 
 
					 
					 
					 
					                                setattr ( self , key , value ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                self . train_dir   =  os . sep . join ( [ self . log_dir , ' train ' , self . CONTEXT ] )                 
 
					 
					 
					 
					                self . train_dir   =  os . sep . join ( [ self . log_dir , ' train ' , self . CONTEXT ] )                 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                self . out_dir  =  os . sep . join ( [ self . log_dir , ' output ' , self . CONTEXT ] ) 
 
					 
					 
					 
					                self . out_dir  =  os . sep . join ( [ self . log_dir , ' output ' , self . CONTEXT ] ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                if  ' partition '  in  args  : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                        self . train_dir  =  os . sep . join ( [ self . train_dir , str ( args [ ' partition ' ] ) ] ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                        self . out_dir  =  os . sep . join ( [ self . out_dir , str ( args [ ' partition ' ] ) ] ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                
 
					 
					 
					 
					                                
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        
 
					 
					 
					 
					                        
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        def  log_meta ( self , * * args )  : 
 
					 
					 
					 
					        def  log_meta ( self , * * args )  : 
 
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -265,9 +274,9 @@ class Generator (GNet):
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                #tf.add_to_collection('glosses', loss) 
 
					 
					 
					 
					                #tf.add_to_collection('glosses', loss) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                tf . compat . v1 . add_to_collection ( ' glosses ' ,  loss ) 
 
					 
					 
					 
					                tf . compat . v1 . add_to_collection ( ' glosses ' ,  loss ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                return  loss ,  loss                 
 
					 
					 
					 
					                return  loss ,  loss                 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        def  load_meta ( self ,  column ) : 
 
					 
					 
					 
					        def  load_meta ( self ,  * * args ) : 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                super ( ) . load_meta ( column ) 
 
					 
					 
					 
					                super ( ) . load_meta ( * * args ) 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                self . discriminator . load_meta ( column ) 
 
					 
					 
					 
					                self . discriminator . load_meta ( * * args ) 
 
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					        def  network ( self , * * args )  : 
 
					 
					 
					 
					        def  network ( self , * * args )  : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                """ 
 
					 
					 
					 
					                """ 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                This  function  will  build  the  network  that  will  generate  the  synthetic  candidates 
 
					 
					 
					 
					                This  function  will  build  the  network  that  will  generate  the  synthetic  candidates 
 
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -454,6 +463,7 @@ class Train (GNet):
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        #       - determine if the GPU/CPU are busy 
 
					 
					 
					 
					                        #       - determine if the GPU/CPU are busy 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        # 
 
					 
					 
					 
					                        # 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        for  i  in  self . GPU_CHIPS  :  #range(self.NUM_GPUS): 
 
					 
					 
					 
					                        for  i  in  self . GPU_CHIPS  :  #range(self.NUM_GPUS): 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                                
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                with  tf . device ( ' /gpu: %d '  %  i ) : 
 
					 
					 
					 
					                                with  tf . device ( ' /gpu: %d '  %  i ) : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                        with  tf . name_scope ( ' %s _ %d '  %  ( ' TOWER ' ,  i ) )  as  scope : 
 
					 
					 
					 
					                                        with  tf . name_scope ( ' %s _ %d '  %  ( ' TOWER ' ,  i ) )  as  scope : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                                if  self . _LABEL  is  not  None  : 
 
					 
					 
					 
					                                                if  self . _LABEL  is  not  None  : 
 
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -559,9 +569,9 @@ class Predict(GNet):
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        
 
					 
					 
					 
					                        
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                # self.MISSING_VALUES = args['no_value'] 
 
					 
					 
					 
					                # self.MISSING_VALUES = args['no_value'] 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                # self.MISSING_VALUES = int(args['no_value']) if args['no_value'].isnumeric() else  np.na if args['no_value'] in ['na','NA','N/A'] else args['no_value'] 
 
					 
					 
					 
					                # self.MISSING_VALUES = int(args['no_value']) if args['no_value'].isnumeric() else  np.na if args['no_value'] in ['na','NA','N/A'] else args['no_value'] 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        def  load_meta ( self ,  column ) : 
 
					 
					 
					 
					        def  load_meta ( self ,  * * args ) : 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                super ( ) . load_meta ( column ) 
 
					 
					 
					 
					                super ( ) . load_meta ( * * args ) 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                self . generator . load_meta ( column ) 
 
					 
					 
					 
					                self . generator . load_meta ( * * args ) 
 
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					                self . ROW_COUNT  =  self . oROW_COUNT 
 
					 
					 
					 
					                self . ROW_COUNT  =  self . oROW_COUNT 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        def  apply ( self , * * args ) : 
 
					 
					 
					 
					        def  apply ( self , * * args ) : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                suffix  =  self . CONTEXT  #self.get.suffix() 
 
					 
					 
					 
					                suffix  =  self . CONTEXT  #self.get.suffix()