Configuration
Relucent exposes numeric defaults and tolerances as module-level attributes on
relucent.config. Library code reads these values when routines run, so you
can tune behavior for your model or hardware without editing source files.
Changing settings
Import the module (or the package namespace) and assign new values:
import relucent
relucent.config.TOL_HALFSPACE_CONTAINMENT = 1e-7
relucent.config.MAX_RADIUS = 500
To set several attributes at once, use relucent.config.update_settings():
from relucent.config import update_settings
update_settings(
TOL_HALFSPACE_CONTAINMENT=1e-7,
DEFAULT_SEARCH_BOUND=1e7,
)
update_settings only accepts names listed under relucent.config.__all__
(excluding the helper itself). Unknown keys raise TypeError.
Defaults in function signatures: Parameters documented as “defaults to
relucent.config.X” resolve that value when the function runs, not when
Python first imports the package. If you pass an argument explicitly, it always
overrides the module setting for that call.
Settings reference
The following tables summarize each public setting. Types and defaults match the
shipped relucent.config module.
Polyhedron and halfspace geometry
Name |
Type |
Default |
Role |
|---|---|---|---|
|
|
|
How Qhull warnings from |
|
|
|
Maximum Chebyshev / interior-point search radius when solving with Gurobi. |
|
|
|
Threshold for trusting vertex positions from HalfspaceIntersection. |
|
|
|
Feasibility tolerance for halfspace containment (\(a^\top x + b \le 0\)) in checks and related geometry. |
|
|
|
Column norm below which a ReLU is treated as dead. |
|
|
|
Hyperplane equality tolerance in SHI computation. |
|
|
|
Norms below this are treated as degenerate halfspace normals. |
|
|
|
Gurobi early-stop tolerances for the SHI MIP models. |
|
|
|
2D plotting: halfspace normals with small |
|
|
|
Default half-width of the bounding box for polyhedron plotting and bounded vertices when not passed explicitly. |
|
|
|
|
Complex search and parallel add
Name |
Type |
Default |
Role |
|---|---|---|---|
|
|
|
Radii tried in order when locating an interior point for a neighbor in |
|
|
|
Default halfspace bound for |
|
|
|
Default halfspace bound for |
|
|
|
Weight on Euclidean-distance bias in the A* heuristic. |
|
|
|
Axis margin multiplier when deriving plot extent from interior points. |
|
|
|
Fallback axis half-extent when no interior points exist (2D complex plots). |
|
|
|
Default bound for |
Utilities and visualization
Name |
Type |
Default |
Role |
|---|---|---|---|
|
|
|
Seconds to wait on |
|
|
|
Matplotlib pie |
|
|
|
Maximum node images generated in |
|
|
|
Examples per node in |
|
|
|
Default output path for the HTML graph. |
Model and grid
Name |
Type |
Default |
Role |
|---|---|---|---|
|
|
|
Half-width of the default 2D input grid for |
|
|
|
Points per axis for that grid. |
API
- relucent.config.update_settings(**kwargs: Any) None
Set one or more
relucent.configattributes.Keys must be names listed in
relucent.config.__all__(excludingupdate_settingsitself). Values replace the current module-level constants.- Parameters:
**kwargs –
NAME=valuepairs matching public config attributes.- Raises:
TypeError – If any key is not a known setting name.
Valid keys for update_settings() are the names listed in
relucent.config.__all__, except update_settings itself.