@ -59,6 +59,7 @@ class GNet :
self . logs = { }
self . NUM_GPUS = 1 if ' num_gpu ' not in args else args [ ' num_gpu ' ]
self . PARTITION = args [ ' partition ' ]
# if self.NUM_GPUS > 1 :
# os.environ['CUDA_VISIBLE_DEVICES'] = "4"
@ -356,7 +357,7 @@ class Train (GNet):
self . meta = self . log_meta ( )
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)
def load_meta ( self , column ) :
@ -408,7 +409,7 @@ class Train (GNet):
# losses = tf.compat.v1.get_collection(flag, scope)
total_loss = tf . add_n ( losses , name = ' total_loss ' )
print ( total_loss )
return total_loss , w
def input_fn ( self ) :
"""
@ -514,7 +515,7 @@ class Train (GNet):
#
#
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 )
#
# @TODO:
@ -623,6 +624,7 @@ class Predict(GNet):
# r = np.zeros((self.ROW_COUNT,len(columns)))
# r = np.zeros(self.ROW_COUNT)
if self . logger :
info = { " found " : len ( found ) , " rows " : df . shape [ 0 ] , " cols " : df . shape [ 1 ] , " expected " : len ( self . values ) }
if INDEX > 0 :
@ -631,6 +633,7 @@ class Predict(GNet):
info [ ' selected ' ] = - 1
info [ ' ratio ' ] = __ratio
info [ ' partition ' ] = self . PARTITION
self . logger . write ( { " module " : " gan-generate " , " action " : " generate " , " input " : info } )
df . columns = 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 ) )
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 } )