Tags: google/pyglove
Tags
Support markdown quotes on the repr/str of Formattable objects. This allows users to use `pg.str_format` and `pg.repr_format` context manager to add markdown quotes to the repr/str of symbolic objects, which serves the scenario when embedding objects within natural language string. PiperOrigin-RevId: 595679721
Smart cross references for PyGlove symbols in Sphinx autodoc. This allows developers to refer to PyGlove symbols in Sphinx documentation in the same way as we write code, e.g. :class:`pg.DNA` or :class:`pg.geno.DNA`, both will output a link with the same canonical symbol name `pg.DNA`. As a result, all mentions of the same symbol will have consistent name across the entire document corpus. PiperOrigin-RevId: 517022666
Dynamic evaluation to support divide-and-conquer on a search space. Example: ``` def fun(): return pg.oneof([1, 2], hints='ssd1') + pg.oneof([3, 4], hints='ssd2') ssd1 = pg.hyper.DynamicEvaluationContext(where=lambda x: x.hints == 'ssd1') ssd2 = pg.hyper.DynamicEvaluationContext(where=lambda x: x.hints == 'ssd2') # Partitioning the search space into ssd1 and ssd2. with ssd1.collect(): with ssd2.collect(): fun() # Nested search. for ex1, f1 in pg.sample(ssd1, algorithm1): rs = [] for ex2, f2 in pg.sample(ssd2, algorithm2): with ex1(): with ex2(): r = fun() f2(r) rs.append(r) f1(sum(rs)) ``` PiperOrigin-RevId: 480115321