compress() Keyword Arguments Listing
See also the documentation for stitch_core.compress()
.
Argument |
Description |
---|---|
|
The |
|
A |
|
Max arity of abstractions to find (will find arities from 0 to this number inclusive). Note that scaling with arity can be very expensive [default: 2] |
|
Prefix used to generate names of new abstractions, by default we will name our abstractions fn_0, fn_1, fn_2, etc [default: fn_] |
|
Allow for abstractions that are only useful in a single task (defaults to False like DreamCoder) |
|
How many worklist items a thread will take at once [default: 1] |
|
Sets cost for applications in the lambda calculus [default: 1] |
|
Sets cost for |
|
Sets cost for lambdas [default: 1] |
|
Sets cost for primitives like |
|
Sets cost for |
|
Extra printouts related to running a dreamcoder comparison. Section 6.1 of Stitch paper https://arxiv.org/abs/2211.16605 |
|
Threads will autoadjust how large their batches are based on the worklist size |
|
Puts result into eta-long form when rewriting (also requires beta-normal form). This can be useful for programs that will be used to train top down synthesizers, but it also restricts what abstractions can be found a bit (i.e. only those that can be put in beta-normal eta-long form are allowed) |
|
Pattern or abstraction to follow and give prinouts about. If |
|
For use with |
|
Method for choosing hole to expand at each step. Doesn’t have a huge effect [default: depth-first] [possible values: random, breadth-first, depth-first, max-largest-subset, high-entropy, low-entropy, max-cost, min-cost, many-groups, few-groups, few-apps] |
|
Maximum number of iterations to run compression for (number of inventions to find, though stitch will stop early if no compressive abstraction exists) [default: 3] |
|
Enables edge case handling where inverting the argument capture subsumption pruning is needed for optimality. Generally not relevant just included for completeness, see the footnoted section of Section 4.3 of the Stitch paper https://arxiv.org/abs/2211.16605 |
|
[currently not used] Number of invention candidates compression_step should return in a single step. Note that these will be the top n optimal candidates modulo subsumption pruning (and the top-1 is guaranteed to be globally optimal) [default: 1] |
|
Disables the safety check for the utility being correct; you only want to do this if you truly dont mind unsoundness for a minute |
|
Disable all optimizations |
|
Disable the arity zero optimization, which searches first for the most compressive arity-zero abstraction since this is extremely fast to find and provides a good starting point for our upper bound pruning. In practice this isn’t a very important optimization |
|
Disable redundant argument elimination pruning (aka “force multiuse”). Section 4.3 of Stitch paper https://arxiv.org/abs/2211.16605 This is a fairly important optimization (ablation study in Section 6.4 of Stitch paper) |
|
Disable the single structurally hashed subtree match pruning. This is a very minor optimization that allows discarding certain abstractions that only match at a single unique subtree as long as that subtree lacks free variables, because arity zero abstractions are always superior in this case |
|
Disable upper bound based pruning. Section 4.2 of Stitch paper https://arxiv.org/abs/2211.16605 This is an extremely important optimization (ablation study in Section 6.4 of Stitch paper) |
|
Disable argument capture pruning (aka “useless abstraction pruning”). Section 4.3 of Stitch paper https://arxiv.org/abs/2211.16605 This is an extremely important optimization (ablation study in Section 6.4 of Stitch paper) |
|
Switch to utility based purely on program size without adding in the abstraction size (aka the “structure penalty” in DreamCoder) |
|
Disable stat logging - note that stat logging in multithreading requires taking a mutex so it can be a source of slowdown in the massively multithreaded case, hence this flag to disable it |
|
Number of previous abstractions that have been found before this round of compression - this is used to calculate what the next abstraction name should be - for example if 2 abstractions have been found previously then the next abstraction will be fn_2 [default: 0] |
|
Print stats this often (0 means never) [default: 0] |
|
Silence all printing within a compression step. See |
|
Print out programs rewritten under abstraction |
|
Used for soundness testing. Whenever you finish an invention do a full rewrite to check that rewriting doesnt raise a cost mismatch exception |
|
Include the dreamcoder-format rewritten programs in the output |
|
For each abstraction learned, includes the rewritten programs right after learning that
abstraction in the output. If |
|
Disables all prinouts except in the case of a panic. See also |
|
Number of threads to use for compression (no parallelism if set to 1) [default: 1] |
|
Calculate utility exhaustively by performing a full rewrite. Used for debugging when cost mismatch exceptions are happening and we need something slow but accurate as a temporary solution |
|
Prints whenever a new best abstraction is found |
|
Very verbose when rewriting happens - turns off –silent and –quiet which are usually forced on in rewriting |
|
Prints every worklist item as it is processed (will slow things down a ton due to rendering out expressions) |