def experiment_pre_save(sender, **kwargs): instance = kwargs['instance'] # Check if declarations need to be set if not instance.declarations and instance.specification: instance.declarations = instance.specification.declarations set_tags(instance=instance) set_persistence(instance=instance) set_outputs(instance=instance) set_outputs_refs(instance=instance) # Add code reference # Check if : # the experiment is new # that it has an exec section # that it's not cloned # that is not an external repo (because we did not clone it yet) # if the instance has a primary key then is getting updated condition = ( not instance.specification or not instance.specification.build or instance.specification.build.git or instance.code_reference or not instance.project.has_code) if condition: return assign_code_reference(instance)
def notebook_job_pre_save(sender, **kwargs): instance = kwargs['instance'] set_tags(instance=instance) set_persistence(instance=instance) set_outputs(instance=instance) set_outputs_refs(instance=instance) assign_code_reference(instance)
def tensorboard_job_pre_save(sender, **kwargs): instance = kwargs['instance'] set_tags(instance=instance) default_persistence_outputs = None if instance.experiment: default_persistence_outputs = instance.experiment.persistence_outputs if instance.experiment_group: default_persistence_outputs = instance.experiment_group.persistence_outputs set_persistence(instance=instance, default_persistence_outputs=default_persistence_outputs) set_outputs(instance=instance) set_outputs_refs(instance=instance) assign_code_reference(instance)
def experiment_pre_save(sender, **kwargs): instance = kwargs['instance'] # Check if declarations need to be set if not instance.declarations and instance.specification: instance.declarations = instance.specification.declarations set_tags(instance=instance) set_persistence(instance=instance) set_outputs(instance=instance) set_outputs_refs(instance=instance) if not instance.specification or not instance.specification.build: return assign_code_reference(instance)
def experiment_group_pre_save(sender, **kwargs): instance = kwargs['instance'] # Add code reference assign_code_reference(instance) # Check if params need to be set if not instance.hptuning and instance.specification: hptuning_config = instance.specification.hptuning hptuning = hptuning_config.to_dict() if hptuning_config.search_algorithm == SearchAlgorithms.GRID: hptuning['grid_search'] = hptuning.get('grid_search', {}) instance.hptuning = hptuning set_tags(instance=instance) set_persistence(instance=instance)
def job_pre_save(sender, **kwargs): instance = kwargs['instance'] set_tags(instance=instance) set_persistence(instance=instance) set_outputs(instance=instance) set_outputs_refs(instance=instance) # Add code reference # Check if : # the job is new # that it has an build section # that is not an external repo (because we did not clone it yet) # if the instance has a primary key then is getting updated condition = (instance.specification.build.git or instance.code_reference or not instance.project.has_code) if condition: return assign_code_reference(instance)