Ejemplo n.º 1
0
 def visitSearchSpaceProduct(
     self, prod: SearchSpaceProduct, path: str, counter=None
 ):
     search_spaces = [
         accept(space, self, self.get_unique_name(make_indexed_name(name, index)))
         for name, index, space in prod.get_indexed_spaces()
     ]
     return search_spaces
Ejemplo n.º 2
0
 def visitSearchSpaceProduct(
     self, prod: SearchSpaceProduct, path: str, counter=None, useCounter=True
 ):
     search_spaces = (
         accept(space, self, self.get_unique_name(make_indexed_name(name, index)))
         for name, index, space in prod.get_indexed_spaces()
     )
     return "[" + ",".join(search_spaces) + "]"
Ejemplo n.º 3
0
    def visitSearchSpaceProduct(self, op:SearchSpaceProduct)->SearchSpaceGridInternalType:

        sub_spaces = op.get_indexed_spaces()

        param_grids:List[List[SearchSpaceGrid]] = [nest_all_HPparams(make_indexed_name(name, index), self.fixupDegenerateSearchSpaces(accept(space,self))) for name,index,space in sub_spaces]

        param_grids_product:Iterable[Iterable[SearchSpaceGrid]] = itertools.product(*param_grids)
        chained_grids:List[SearchSpaceGrid] = [
            dict(ChainMap(*gridline)) for gridline in param_grids_product]

        return chained_grids