LaNAS/Distributed_LaNAS/server/Node.py [30:74]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if parent is not None:
            self.parent.kids.append(self)
            if self.parent.is_leaf  == True:
                self.parent.is_leaf = False
            assert len(self.parent.kids) <= 2
        self.kids          = []
        self.bag           = { }
        self.good_kid_data = {}
        self.bad_kid_data  = {}

        self.is_leaf       = True
        self.id            = Node.obj_counter
        
        #data for good and bad kids, respectively
        Node.obj_counter += 1
    
    def visit(self):
        self.n += 1
    
    def collect_sample(self, arch, acc):
        self.bag[json.dumps(arch) ] = acc
        self.n                      = len( self.bag )
    
    def print_bag(self):
        print("BAG"+"#"*10)
        for k, v in self.bag.items():
            print("arch:", k, "acc:", v)
        print("BAG"+"#"*10)
        print('\n')

    
    def put_in_bag(self, net, acc):
        assert type(net) == type([])
        assert type(acc) == type(float(0.1))
        net_k = json.dumps(net)
        self.bag[net_k] = acc
    
    def get_name(self):
        # state is a list of jsons
        return "node" + str(self.id)
    
    def pad_str_to_8chars(self, ins):
        if len(ins) <= 14:
            ins += ' '*(14 - len(ins) )
            return ins
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



LaNAS/LaNAS_NASBench101/Node.py [31:75]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if parent is not None:
            self.parent.kids.append(self)
            if self.parent.is_leaf  == True:
                self.parent.is_leaf = False
            assert len(self.parent.kids) <= 2
        self.kids          = []
        self.bag           = { }
        self.good_kid_data = {}
        self.bad_kid_data  = {}

        self.is_leaf       = True
        self.id            = Node.obj_counter
        
        #data for good and bad kids, respectively
        Node.obj_counter += 1
    
    def visit(self):
        self.n += 1
    
    def collect_sample(self, arch, acc):
        self.bag[json.dumps(arch) ] = acc
        self.n                      = len( self.bag )
    
    def print_bag(self):
        print("BAG"+"#"*10)
        for k, v in self.bag.items():
            print("arch:", k, "acc:", v)
        print("BAG"+"#"*10)
        print('\n')

    
    def put_in_bag(self, net, acc):
        assert type(net) == type([])
        assert type(acc) == type(float(0.1))
        net_k = json.dumps(net)
        self.bag[net_k] = acc
    
    def get_name(self):
        # state is a list of jsons
        return "node" + str(self.id)
    
    def pad_str_to_8chars(self, ins):
        if len(ins) <= 14:
            ins += ' '*(14 - len(ins) )
            return ins
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



