BACON
** Making Agents Reason Like Humans **
In the 1970s, Jozo Dujmovic envisioned a real-valued logic system designed to reflect how people actually make decisions. He called it Graded Logic. Rather than relying on rigid true-or-false rules, it captures nuance, trade-offs, and degrees of preference during human decision processes. Building on this idea, he developed the Logic Scoring of Preference (LSP), a structured approach that enables professionals to reason through complex decisions with clarity and consistency. Over the past fifty years, these ideas have been used to support high-stakes decision making in areas such as vendor selection, medical diagnosis, and the evaluation of complex systems.
Fast forwarding to 2020s, autonomous agents and intelligent systems are increasingly making decisions on behalf of humans, often in mission-critical and safety-sensitive scenarios. Yet many of these systems operate as opaque black boxes, making it difficult to understand why a decision was made, to diagnose failures, or to ensure alignment with human values, policies, and regulatory requirements. As these systems become more capable and more widely deployed, the need for transparency, control, and trust becomes essential.
BACON brings the principles of Graded Logic and LSP into modern AI systems. It enables agents to reason in ways that reflect human thinking, to produce decisions that can be understood and explained, and to operate under meaningful human guidance. By making decision processes transparent, interpretable, and controllable, BACON helps ensure that intelligent systems are not only powerful, but also trustworthy and aligned with the people who depend on them.
Getting Started
Install BACON as a Python package:
pip install bacon-net
Then use it in your code:
import torch
from bacon.baconNet import baconNet
from bacon.visualization import print_tree_structure
from bacon.utils import generate_classic_boolean_data
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
x, y, expr_info = generate_classic_boolean_data(3, device=device)
model = baconNet(3, aggregator='bool.min_max', tree_layout='left')
model.find_best_model(x, y, x, y, max_epochs=900, save_model=False)
print_tree_structure(model.assembler, expr_info['var_names'], classic_boolean=True, layout='left')
BACON also ships with a CLI for quick demos and model tooling:
bacon demo hello-world # run the hello-world demo
bacon demo hello-world --variables 5 # try with more variables
bacon distill model.json output.py # distill a model to standalone code
For full documentation, visit the BACON docs or clone this repository and open docs/index.html.
Samples
Explore the samples/ directory for end-to-end examples on real datasets:
- Hello, World! — Discover a Boolean expression from synthetic data
- Breast Cancer — Diagnosis prediction on the UCI Breast Cancer dataset
- Heart Disease — Prediction using the UCI Heart Disease dataset
Release files for bacon-net 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bacon_net-0.3.3.tar.gz | 145.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bacon_net-0.3.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 288.7 kB
Release files / bacon_net-0.3.3.tar.gz
| Download URL | bacon_net-0.3.3.tar.gz |
|---|---|
| Size | 145.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52d0f5fddb3ab1956308bfde49b83839e1673b7919be93410d711f1360403f0c
|
|
BLAKE2b-256 checksum How to use checksums |
7c0abfe38c2329c3078244b37b1c788998671d4dd1c4885207af0cec18450149
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / bacon_net-0.3.3-py3-none-any.whl
| Download URL | bacon_net-0.3.3-py3-none-any.whl |
|---|---|
| Size | 143.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
51d379548474394a2f543063f5b06127d41d62584ce4907f42f01c9474486e6c
|
|
BLAKE2b-256 checksum How to use checksums |
4b97cc55357fc65dd8019da97ddd1bfa6b637dfb6f6fb53bf3599aa03c49d905
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|