@ -59,6 +59,7 @@ class GNet :
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                self . logs  =  { } 
 
					 
					 
					 
					                self . logs  =  { } 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                self . NUM_GPUS  =  1  if  ' num_gpu '  not  in  args  else  args [ ' num_gpu ' ] 
 
					 
					 
					 
					                self . NUM_GPUS  =  1  if  ' num_gpu '  not  in  args  else  args [ ' num_gpu ' ] 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                self . PARTITION  =  args [ ' partition ' ] 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                # if self.NUM_GPUS > 1 : 
 
					 
					 
					 
					                # if self.NUM_GPUS > 1 : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                #     os.environ['CUDA_VISIBLE_DEVICES'] = "4" 
 
					 
					 
					 
					                #     os.environ['CUDA_VISIBLE_DEVICES'] = "4" 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -356,7 +357,7 @@ class Train (GNet):
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                self . meta  =  self . log_meta ( ) 
 
					 
					 
					 
					                self . meta  =  self . log_meta ( ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                if ( self . logger ) : 
 
					 
					 
					 
					                if ( self . logger ) : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        
 
					 
					 
					 
					                        
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        self . logger . write ( { " module " : " gan-train " , " action " : " start " , " input " : self . meta }  ) 
 
					 
					 
					 
					                        self . logger . write ( { " module " : " gan-train " , " action " : " start " , " input " : { " partition " : self . PARTITION , " meta " : self . meta }  }  ) 
 
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					                
 
					 
					 
					 
					                
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                # self.log (real_shape=list(self._REAL.shape),label_shape = self._LABEL.shape,meta_data=self.meta) 
 
					 
					 
					 
					                # self.log (real_shape=list(self._REAL.shape),label_shape = self._LABEL.shape,meta_data=self.meta) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        def  load_meta ( self ,  column ) : 
 
					 
					 
					 
					        def  load_meta ( self ,  column ) : 
 
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -408,7 +409,7 @@ class Train (GNet):
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                # losses = tf.compat.v1.get_collection(flag, scope) 
 
					 
					 
					 
					                # losses = tf.compat.v1.get_collection(flag, scope) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                total_loss  =  tf . add_n ( losses ,  name = ' total_loss ' ) 
 
					 
					 
					 
					                total_loss  =  tf . add_n ( losses ,  name = ' total_loss ' ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
 
					 
					 
					 
					                print  ( total_loss )  
 
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					                return  total_loss ,  w 
 
					 
					 
					 
					                return  total_loss ,  w 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        def  input_fn ( self ) : 
 
					 
					 
					 
					        def  input_fn ( self ) : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                """ 
 
					 
					 
					 
					                """ 
 
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -514,7 +515,7 @@ class Train (GNet):
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                                # 
 
					 
					 
					 
					                                                # 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                                # 
 
					 
					 
					 
					                                                # 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                                if  self . logger  : 
 
					 
					 
					 
					                                                if  self . logger  : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                                        row  =  { " module " : " gan-train " , " action " : " logs " , " input " : logs }  #,"model":pickle.dump(sess)}                                                         
 
					 
					 
					 
					                                                        row  =  { " module " : " gan-train " , " action " : " logs " , " input " : { " partition " : self . PARTITION , " logs " : logs } }  #,"model":pickle.dump(sess)}                                                         
 
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					                                                        self . logger . write ( row ) 
 
					 
					 
					 
					                                                        self . logger . write ( row ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                                        # 
 
					 
					 
					 
					                                                        # 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                                        # @TODO: 
 
					 
					 
					 
					                                                        # @TODO: 
 
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -623,6 +624,7 @@ class Predict(GNet):
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        
 
					 
					 
					 
					                        
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        # r = np.zeros((self.ROW_COUNT,len(columns))) 
 
					 
					 
					 
					                        # r = np.zeros((self.ROW_COUNT,len(columns))) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        # r = np.zeros(self.ROW_COUNT) 
 
					 
					 
					 
					                        # r = np.zeros(self.ROW_COUNT) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                        
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        if  self . logger  : 
 
					 
					 
					 
					                        if  self . logger  : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                info  =  { " found " : len ( found ) , " rows " : df . shape [ 0 ] , " cols " : df . shape [ 1 ] , " expected " : len ( self . values ) } 
 
					 
					 
					 
					                                info  =  { " found " : len ( found ) , " rows " : df . shape [ 0 ] , " cols " : df . shape [ 1 ] , " expected " : len ( self . values ) } 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                if  INDEX  >  0  : 
 
					 
					 
					 
					                                if  INDEX  >  0  : 
 
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -631,6 +633,7 @@ class Predict(GNet):
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                        
 
					 
					 
					 
					                                        
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                        info [ ' selected ' ]  =  - 1 
 
					 
					 
					 
					                                        info [ ' selected ' ]  =  - 1 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                        info [ ' ratio ' ]  =  __ratio 
 
					 
					 
					 
					                                        info [ ' ratio ' ]  =  __ratio 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                                info [ ' partition ' ]  =  self . PARTITION 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                self . logger . write ( { " module " : " gan-generate " , " action " : " generate " , " input " : info } ) 
 
					 
					 
					 
					                                self . logger . write ( { " module " : " gan-generate " , " action " : " generate " , " input " : info } ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        df . columns  =  self . values 
 
					 
					 
					 
					                        df . columns  =  self . values 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        if  len ( found )  or  df . columns . size  ==  len ( self . values ) : 
 
					 
					 
					 
					                        if  len ( found )  or  df . columns . size  ==  len ( self . values ) : 
 
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -658,7 +661,7 @@ class Predict(GNet):
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                df  =  df [ columns [ 0 ] ] . append ( pd . Series ( missing ) ) 
 
					 
					 
					 
					                                df  =  df [ columns [ 0 ] ] . append ( pd . Series ( missing ) ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                if  self . logger  : 
 
					 
					 
					 
					                                if  self . logger  : 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                        
 
					 
					 
					 
					                                        
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                                        info =  { " missing " :  i . size , " rows " : df . shape [ 0 ] , " cols " : 1  }
 
					 
					 
					 
					                                        info =  { " missing " :  i . size , " rows " : df . shape [ 0 ] , " cols " : 1 ,' partition ' : self . PARTITION  }
 
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					                                        self . logger . write ( { " module " : " gan-generate " , " action " : " compile.io " , " input " : info } ) 
 
					 
					 
					 
					                                        self . logger . write ( { " module " : " gan-generate " , " action " : " compile.io " , " input " : info } )