Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,26 @@ brute-force reference or a closed-form value and has a regression test.
both sides, and rose above no upper end. On 30 two-state processes, 600 s per side certified 5 and came within
`1e-6` of 7.

### Global bounds: bound tightening off, chords as the second opinion

- `generator_global_bound` and `separating_global_bound` take `entropy="log"` (the default, SCIP's entropy
expression) or `entropy="chords"`. The chords replace each `-w log2 w` by its chords on a grid of masses, an SOS2
constraint (Beale & Tomlin 1970), and solve again with the minimizer's weights added to the grids, each round
warm-started from the last, until the chords meet the entropy to `1e-9`. They lie below the entropy, so the dual
bound and an "infeasible" verdict hold for the entropy itself and `slack` is 0. Results carry `entropy`, `rounds`
and `chord_gap`.
- `obbt` now defaults to `False`. On SCIP's entropy expression, bound tightening cut the optimum off a 3 x 3 joint at
`k = 3` ("optimal" 1.447803 against a feasible 1.343763) while the entropy variables were created first, and
whether it does depends on details as small as the model's variable order. The second opinion of
`separating_decomposition` is now `entropy="chords", presolve=False` (it was `presolve=False, obbt=False`).
- Validation. On the restricted global bound at `K(P)` of 29 small processes (240 s each, about 12 runs at a time),
the chords never rose above a known generator's entropy by more than `6e-7` (SCIP's feasibility tolerance), but
they were at least 3.6 times slower than the entropy expression with bound tightening wherever both finished, and
closed 1 of the brackets it closed 6 of. With bound tightening off, the entropy expression took 1.2 to 4.4 times
as long on 9 closable brackets and did not finish 3 of them in 240 s, 2 of which it finished with bound tightening
on. On the static bound of 3 joints at `k = 5` the chords took 3 to 15 times as long, and all three settings agreed
to `1e-5`.

### Drawing from a terminal

- `draw()` with no filename shows the diagram: inline in terminals that support the kitty graphics protocol (kitty,
Expand Down
8 changes: 6 additions & 2 deletions docs/generators/generative_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,12 @@ bound is known, and :math:`\min(|S^+|, |S^-|) + 1` is not one: the skip-one chai
`Supports without 2 × 2 rectangles`_) needs :math:`|S^+| + 2` states. When both persistent
crypticities vanish (cryptic order at most 1), ``k`` equal to :math:`K(P)` suffices
(:doc:`separating_generators`). It is also numerical, not a certificate: the equations with data on the right-hand side are relaxed by ``data_tol``, and SCIP
works to its own tolerances, and its presolve and optimization-based bound tightening can go wrong
(``presolve=False, obbt=False`` gives a second opinion; see :doc:`separating_generators`).
works to its own tolerances, and its presolve and optimization-based bound tightening can go wrong.
Bound tightening is off by default (``obbt=True`` turns it on, which can close a bound several times
faster), and ``entropy="chords", presolve=False`` gives a second opinion: each entropy term is replaced
by its chords, an SOS2 constraint :cite:`Beale1970` refined at the minimizer, which lie below the
entropy, so the dual bound holds for the entropy itself (see :doc:`separating_generators`). SCIP takes
several times longer on the chords.
:func:`~sofic.generators.global_bound.separating_global_bound` is the static version, over separating
decompositions with ``k`` terms. SCIP's solution satisfies necessary conditions only;
:func:`~sofic.generators.hmm_search.hmm_generator_search` with ``initial`` polishes it into a
Expand Down
9 changes: 6 additions & 3 deletions docs/generators/separating_generators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ over decompositions with the component's :math:`K` terms
SCIP needs a second opinion. On Kumar, Li and El Gamal's Example 2, the erasure joint
:math:`\begin{pmatrix} 0.05 & 0 & 0.45 \\ 0 & 0.05 & 0.45 \end{pmatrix}`, presolve declares the model with
:math:`k = 2` infeasible, though :math:`W = S^+` is feasible. On the :math:`3 \times 3` joint with five cells in
``tests/test_separating_generators.py``, optimization-based bound tightening (OBBT) at :math:`k = 3` cuts off the
optimum and SCIP reports "optimal" at :math:`1.447803`, above a feasible :math:`1.343763`. With presolve and OBBT
off (``presolve=False, obbt=False``) both come out right. Each component therefore runs both settings, an
``tests/test_separating_generators.py``, optimization-based bound tightening (OBBT) at :math:`k = 3` cut off the
optimum and SCIP reported "optimal" at :math:`1.447803`, above a feasible :math:`1.343763`. Whether it does depends
on details as small as the order in which the model's variables are created, so OBBT is off by default. The second
opinion (``entropy="chords", presolve=False``) turns presolve off and replaces SCIP's entropy expression by its
chords, an SOS2 constraint :cite:`Beale1970` refined at the minimizer; the chords lie below the entropy, so its dual
bound holds for the entropy itself. Both joints come out right under it. Each component therefore runs both settings, an
"infeasible" counts as no bound (a decomposition with :math:`K` terms always exists), and the smaller dual bound is
the component's lower bound. SCIP's primal solutions satisfy the constraints only to about :math:`10^{-6}`, which
can put their entropy below the true optimum, so each is reduced, projected onto exact decompositions by least
Expand Down
Loading
Loading