def calc_tree(root): for node in PostOrderIter(root): config = node.config configs_child = [node_child.config for node_child in node.children] context = Context(config) context.pipeline(config, configs_child)
def calc_tree(root): for node in PreOrderIter(root): params = copy.deepcopy(node.config.experiment.params) node.config.experiment.params = {} node_json = jsonpickle.encode(node).encode('utf-8') node.config.experiment.params = params hash = hashlib.md5(node_json).hexdigest() node.config.set_hash(hash) save_info(node) for node in PostOrderIter(root): config = node.config configs_child = [node_child.config for node_child in node.children] context = Context(config) context.pipeline(config, configs_child)
def load_beta_config(data, annotations, attributes, data_params=None): config = Config(data=copy.deepcopy(data), experiment=Experiment( data=DataType.betas, task=Task.load, method=Method.mock, data_params=copy.deepcopy(data_params)), annotations=copy.deepcopy(annotations), attributes=copy.deepcopy(attributes), is_run=True, is_root=True) context = Context(config) context.load(config) return config
def check_strategy(self, data_type, task, needed_list): experiment = Experiment( data=data_type, task=task, method=None, ) self.config.experiment = experiment context = Context(self.config) condition = True real_list = ['load_strategy', 'get_strategy', 'setup_strategy', 'run_strategy', 'release_strategy', 'save_strategy'] real_list = [getattr(context, x) for x in real_list] for real, needed in zip(real_list, needed_list): if type(real) != needed: condition = False break return condition
def plot(config, configs_primary): config.initialize() for config_primary in configs_primary: config_primary.initialize() context = Context(config) context.plot_pipeline(config, configs_primary)
def advanced(config, configs_primary): config.initialize() for config_primary in configs_primary: config_primary.initialize() context = Context(config) context.advanced_pipeline(config, configs_primary)
def base(config): config.initialize() context = Context(config) context.base_pipeline(config)