def evaluate(self, block_material: BlockMaterial, block_def,#: BlockDefinition, training_datapair: ezData, validation_datapair: ezData): ''' stuff the old code has but unclear why gpus = tf.config.experimental.list_physical_devices('GPU') #tf.config.experimental.set_virtual_device_configuration(gpus[0],[ tf.config.experimental.VirtualDeviceConfiguration(memory_limit = 1024*3) ]) ''' ezLogging.info("%s - Start evaluating..." % (block_material.id)) try: self.build_graph(block_material, block_def, training_datapair) except Exception as err: ezLogging.critical("%s - Build Graph; Failed: %s" % (block_material.id, err)) block_material.dead = True import pdb; pdb.set_trace() return try: output = self.train_graph(block_material, block_def, training_datapair, validation_datapair) except Exception as err: ezLogging.critical("%s - Train Graph; Failed: %s" % (block_material.id, err)) block_material.dead = True import pdb; pdb.set_trace() return block_material.output = output # TODO make sure it is a list
def evaluate(self, block_material: BlockMaterial, block_def,#: BlockDefinition, training_datapair: ezData, validation_datapair: ezData=None): ezLogging.info("%s - Start evaluating..." % (block_material.id)) output_list = self.standard_evaluate(block_material, block_def, training_datapair.x) #training_datapair.x = output_list[0] #block_material.output = training_datapair block_material.output = output_list
def evaluate(self, block_material: BlockMaterial, block_def, #: BlockDefinition, training_datapair: ezData, validation_datapair: ezData): ezLogging.info("%s - Start evaluating..." % (block_material.id)) output_list = self.standard_evaluate(block_material, block_def, [training_datapair.pipeline]) training_datapair.pipeline = output_list[0] #assuming only outputs the pipeline block_material.output = [training_datapair, validation_datapair]
def evaluate(self, block_material: BlockMaterial, block_def,#: BlockDefinition, training_datapair: ezData, validation_datapair: ezData): ezLogging.info("%s - Start evaluating..." % (block_material.id)) try: self.build_graph(block_material, block_def, training_datapair) except Exception as err: ezLogging.critical("%s - Build Graph; Failed: %s" % (block_material.id, err)) block_material.dead = True import pdb; pdb.set_trace() return block_material.output = [training_datapair, validation_datapair]
def evaluate(self, block_material: BlockMaterial, block_def,#: BlockDefinition, training_datapair: ezData, validation_datapair: ezData): ezLogging.info("%s - Start evaluating..." % (block_material.id)) # going to treat training + validation as separate block_materials! output = [] for datapair in [training_datapair, validation_datapair]: single_output_list = self.standard_evaluate(block_material, block_def, [datapair.pipeline]) datapair.pipeline = single_output_list[0] if block_material.dead: return [] else: output.append(datapair) self.preprocess_block_evaluate(block_material) #prep for next loop through datapair block_material.output = output
def evaluate(self, block_material: BlockMaterial, block_def,#: BlockDefinition, training_datapair: ezData, validation_datapair: ezData): ezLogging.info("%s - Start evaluating..." % (block_material.id)) try: # check if this fails our conditions if block_def.main_count != 1: raise self.TooManyMainNodes(block_def.main_count) if 0 not in block_material.active_nodes: raise self.NoActiveMainNodes(block_material.active_nodes) # good to continue to build self.build_graph(block_material, block_def, training_datapair) except Exception as err: ezLogging.critical("%s - Build Graph; Failed: %s" % (block_material.id, err)) block_material.dead = True import pdb; pdb.set_trace() return block_material.output = [training_datapair, validation_datapair]
def evaluate(self, block_material: BlockMaterial, block_def,#: BlockDefinition, training_datapair: ezData, validation_datapair: ezData): ezLogging.info("%s - Start evaluating..." % (block_material.id)) try: self.build_graph(block_material, block_def, training_datapair.pipeline_wrapper) except Exception as err: ezLogging.critical("%s - Build Graph; Failed: %s" % (block_material.id, err)) block_material.dead = True import pdb; pdb.set_trace() return try: # outputs a list of the validation metrics output = self.train_graph(block_material, block_def, training_datapair, validation_datapair) except Exception as err: ezLogging.critical("%s - Train Graph; Failed: %s" % (block_material.id, err)) block_material.dead = True import pdb; pdb.set_trace() return block_material.output = [None, output] # TODO make sure it is a list