algos/utils.py
def fit_decision_trees_to_algorithms(algorithms):
    '''
    Given a list of algorithms, fit a decision tree for its
    concept -> output or concept -> termination mapping
    '''
    for name, algorithm in algorithms.items():
        algorithm.cto_decision_tree = DecisionTreeClassifier()

        # concatenate concepts/predictions from each batch into one tensor
        all_concepts = torch.cat(algorithm.actual['concepts'], dim=0)
        
        all_target = torch.cat(algorithm.actual['outputs'], dim=0)
        all_termination_target = torch.cat(algorithm.actual['terminations'], dim=0)

        algorithm.cto_decision_tree.fit(all_concepts.cpu(), all_target.cpu())

    Given a list of algorithms, fit a decision tree for its
    concept -> output or concept -> termination mapping
    
Given a list of algorithms, fit a decision tree for its
concept -> output or concept -> termination mapping
Given a list of algorithms fit a decision tree for its concept - > output or concept - > termination mapping
def fit_decision_trees_to_algorithms(algorithms):
    for name, algorithm in algorithms.items():
        algorithm.cto_decision_tree = DecisionTreeClassifier()
        all_concepts = torch.cat(algorithm.actual['concepts'], dim=0)
        all_target = torch.cat(algorithm.actual['outputs'], dim=0)
        all_termination_target = torch.cat(algorithm.actual['terminations'], dim=0)
        algorithm.cto_decision_tree.fit(all_concepts.cpu(), all_target.cpu())
def fit_decision_trees_to_algorithms ( algorithms ) : for name , algorithm in algorithms . items ( ) : algorithm . cto_decision_tree = DecisionTreeClassifier ( ) all_concepts = torch . cat ( algorithm . actual [ 'concepts' ] , dim = 0 ) all_target = torch . cat ( algorithm . actual [ 'outputs' ] , dim = 0 ) all_termination_target = torch . cat ( algorithm . actual [ 'terminations' ] , dim = 0 ) algorithm . cto_decision_tree . fit ( all_concepts . cpu ( ) , all_target . cpu ( ) )
Given a list of algorithms, fit a decision tree for its
concept -> output or concept -> termination mapping
Given a list of algorithms fit a decision tree for its concept - > output or concept - > termination mapping
'''
    Given a list of algorithms, fit a decision tree for its
    concept -> output or concept -> termination mapping
    ''' # concatenate concepts/predictions from each batch into one tensor

algorithms