Skip to content

v0.1.24 Added Weighting

Compare
Choose a tag to compare
@mlb2251 mlb2251 released this 29 Nov 21:49
· 3 commits to main since this release

Added weighting:

  • Now stitch_core.compress() can be called with a weights keyword argument that is a list of float weights equal in length to the number of programs. You can think of the "size" of the original corpus as now being the sum of size of each program multiplied by its weight. If we have multiple programs per task, it works as you would expect – the min is taken after multiplying each program size by its weight.
  • Note that fields like init_cost, final_cost, and compressivity / multiplier / cumulative multiplier fields returned will all be with respect to the weighted value
  • Weights default to all 1.0s so there is no change in behavior from the old behavior if you dont provide weights
  • Weights can be used to deprioritize finding abstractions in lower-weight programs - while still fitting into the compression utility paradigm, since we can just imagine that the lower weight programs are treated as being smaller
  • Per-task weights can be easily implemented by repeating the same weight for all programs within a task