Metadata-Version: 2.4
Name: epalea
Version: 1.0.2
Summary: Latent Factor Posteriors — evidential probabilistic inference
Author-email: Epalea Team <team@epalea.ai>
License:                                  Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
        
           1. Definitions.
        
              "License" shall mean the terms and conditions for use, reproduction,
              and distribution as defined by Sections 1 through 9 of this document.
        
              "Licensor" shall mean the copyright owner or entity authorized by
              the copyright owner that is granting the License.
        
              "Legal Entity" shall mean the union of the acting entity and all
              other entities that control, are controlled by, or are under common
              control with that entity. For the purposes of this definition,
              "control" means (i) the power, direct or indirect, to cause the
              direction or management of such entity, whether by contract or
              otherwise, or (ii) ownership of fifty percent (50%) or more of the
              outstanding shares, or (iii) beneficial ownership of such entity.
        
              "You" (or "Your") shall mean an individual or Legal Entity
              exercising permissions granted by this License.
        
              "Source" form shall mean the preferred form for making modifications,
              including but not limited to software source code, documentation
              source, and configuration files.
        
              "Object" form shall mean any form resulting from mechanical
              transformation or translation of a Source form, including but
              not limited to compiled object code, generated documentation,
              and conversions to other media types.
        
              "Work" shall mean the work of authorship made available under
              the License, as indicated by a copyright notice that is included in
              or attached to the work.
        
              "Derivative Works" shall mean any work, whether in Source or Object
              form, that is based on (or derived from) the Work.
        
              "Contribution" shall mean any work of authorship submitted to the
              Licensor for inclusion in the Work.
        
              "Contributor" shall mean Licensor and any Legal Entity on behalf of
              whom a Contribution has been received by the Licensor.
        
           2. Grant of Copyright License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              copyright license to reproduce, prepare Derivative Works of,
              publicly display, publicly perform, sublicense, and distribute the
              Work and such Derivative Works in Source or Object form.
        
           3. Grant of Patent License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              patent license to make, use, sell, offer for sale, import, and
              otherwise transfer the Work.
        
           4. Redistribution. You may reproduce and distribute copies of the
              Work or Derivative Works thereof in any medium, with or without
              modifications, and in Source or Object form, provided that You
              meet the following conditions:
        
              (a) You must give any other recipients of the Work or Derivative
                  Works a copy of this License; and
        
              (b) You must cause any modified files to carry prominent notices
                  stating that You changed the files; and
        
              (c) You must retain, in the Source form of any Derivative Works
                  that You distribute, all copyright, patent, trademark, and
                  attribution notices from the Source form of the Work; and
        
              (d) If the Work includes a "NOTICE" text file, you must include a
                  readable copy of the attribution notices contained within such
                  NOTICE file.
        
           5. Submission of Contributions. Unless You explicitly state otherwise,
              any Contribution submitted for inclusion in the Work shall be under
              the terms and conditions of this License, without any additional
              terms or conditions.
        
           6. Trademarks. This License does not grant permission to use the trade
              names, trademarks, service marks, or product names of the Licensor.
        
           7. Disclaimer of Warranty. Unless required by applicable law or
              agreed to in writing, Licensor provides the Work on an "AS IS"
              BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
        
           8. Limitation of Liability. In no event and under no legal theory,
              whether in tort (including negligence), contract, or otherwise,
              shall any Contributor be liable to You for damages.
        
           9. Accepting Warranty or Additional Liability. While redistributing
              the Work or Derivative Works thereof, You may choose to offer
              additional warranty, support, indemnity, or other liability
              obligations. However, in accepting such obligations, You may act
              only on Your own behalf and on Your sole responsibility.
        
           END OF TERMS AND CONDITIONS
        
           Copyright 2025 Epalea Team
        
           Licensed under the Apache License, Version 2.0 (the "License");
           you may not use this file except in compliance with the License.
           You may obtain a copy of the License at
        
               http://www.apache.org/licenses/LICENSE-2.0
        
Project-URL: Homepage, https://epalea.ai
Project-URL: Documentation, https://epalea.ai/docs
Project-URL: Repository, https://github.com/epalea/epalea
Project-URL: Bug Tracker, https://github.com/epalea/epalea/issues
Keywords: probabilistic-inference,bayesian,uncertainty,spn,vae
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.0.0
Requires-Dist: numpy>=1.24
Requires-Dist: faiss-cpu>=1.7.4
Requires-Dist: sentence-transformers>=2.2.0
Requires-Dist: jsonlines>=3.1.0
Requires-Dist: typer>=0.9.0
Requires-Dist: typing-extensions>=4.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: scikit-learn>=1.3
Requires-Dist: tqdm>=4.65
Requires-Dist: huggingface_hub>=0.20
Provides-Extra: notebooks
Requires-Dist: jupyter>=1.0; extra == "notebooks"
Requires-Dist: ipykernel>=6.0; extra == "notebooks"
Requires-Dist: matplotlib>=3.7; extra == "notebooks"
Requires-Dist: pandas>=2.0; extra == "notebooks"
Requires-Dist: seaborn>=0.12; extra == "notebooks"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.1; extra == "dev"
Dynamic: license-file

# Epalea — Latent Posterior Factors (LPF)

Research and systems for multi-evidence reasoning, uncertainty quantification, and probabilistic inference.

[![LPF Pipeline Diagram](figures/pipeline_diagram.svg)](figures/pipeline_diagram.svg)

[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![Weight License](https://img.shields.io/badge/Weights-Epalea%20Weight%20License-orange)](pretrained/WEIGHT_LICENSE.md)
[![Docs](https://img.shields.io/badge/docs-epalea.ai%2Fdocs-green)](https://epalea.ai/docs)

LPF (Latent Factor Posteriors) encodes evidence items into latent Gaussian posteriors,
then decodes them into soft likelihood factors for tractable Sum-Product Network reasoning.

## Quick Install

```bash
pip install epalea
```

## 5-Minute Quickstart

```python
import epalea

model = epalea.load_model("compliance-v1")  # downloads from HF automatically

result = model.infer(entity_id="C0001", mode="both")
print(result.results.spn.prediction)        
print(result.results) 
print(result.uncertainty)        
```

## CLI

```bash
epalea generate-data --domain compliance --n-entities 300
epalea train         --config ./user_workspace/configs/train.yaml
epalea index         --config ./user_workspace/configs/index.yaml
epalea train-aggregator --config ./user_workspace/configs/train_aggregator.yaml
epalea infer         --entity-id C0001 --mode both
```

## Pretrained Weights

| Model | Domain | Hugging Face |
|---|---|---|
| `compliance-v1` | Compliance scoring | [aaaEpalea/epalea-compliance-v1](https://huggingface.co/aaaEpalea/epalea-compliance-v1) |

Weights download automatically on first use — no manual setup needed:

```python
model = epalea.load_model("compliance-v1")  # downloads from HF on first call
```

## Papers

Latent Posterior Factors (LPF) is developed across a structured research program:

### Core Framework

**I Know What I Don't Know: Latent Posterior Factor Models for Multi-Evidence Probabilistic Reasoning**
Introduces LPF as a unified probabilistic framework for aggregating multi-source evidence with calibrated uncertainty.
- arXiv: https://arxiv.org/abs/2603.15670
- Zenodo: https://zenodo.org/records/19183861

**Theoretical Foundations of Latent Posterior Factors: Formal Guarantees for Multi-Evidence Reasoning**
Provides formal guarantees, theoretical grounding, and convergence properties of LPF models.
- arXiv: https://arxiv.org/abs/2603.15674
- Zenodo: https://zenodo.org/records/19184458

---

### Architecture & Systems Analysis

**Dissecting Hybrid Neuro-Symbolic Systems: An Architectural Ablation Study of the Latent Probabilistic Framework**
Analyzes LPF components through ablation to identify contributions of architecture modules.
- Zenodo: https://zenodo.org/records/19186405

---

### Safety & Decision-Making

**Safety-Critical Decision Making for Autonomous Machines: A Probabilistic Framework with Uncertainty-Based Human Handoff**
Proposes uncertainty-aware decision thresholds enabling safe human intervention.
- Zenodo: https://zenodo.org/records/19187781

---

### Generalization & Transfer

**Cross-Domain Transfer and Calibration Analysis for Latent Probabilistic Frameworks**
Studies generalization and calibration behavior of LPF across domains.
- Zenodo: https://zenodo.org/records/19201876

---

### Reasoning & Verification

**Exact Uncertainty Decomposition for Multi-Evidence Fact Verification: A Formal Alternative to LLM-Based Reasoning**
Introduces exact decomposition of uncertainty for verifiable multi-evidence reasoning.
- Zenodo: https://zenodo.org/records/19202524

---

### Robustness

**Robustness Under Noise: A Comprehensive Analysis of Latent Factor Posterior Models in Noisy Compliance Environments**
Evaluates LPF stability and degradation under structured and unstructured noise.
- Zenodo: https://zenodo.org/records/19203043

---

### Scientific Applications

**Uncertainty-Aware Quantum State Tomography via Latent Posterior Factors: A Multi-Evidence Aggregation Approach**
Applies LPF to quantum state reconstruction with uncertainty-aware inference.
- Zenodo: https://zenodo.org/records/19203267

---

### Scalability

**Scalability of Latent Factor Posteriors to Varying Evidence Pool Sizes**
Examines how LPF scales with increasing number and diversity of evidence sources.
- Zenodo: https://zenodo.org/records/19203493

---

### Interpretability & UX

**Understanding Provenance: A User Study on Explainability in Probabilistic Multi-Evidence Reasoning Systems**
Investigates user understanding of LPF explanations and provenance tracking.
- Zenodo: https://zenodo.org/records/19203617

## About Epalea

Epalea is a research-driven effort focused on building reliable and interpretable AI systems grounded in principled probabilistic reasoning.

https://epalea.com

## License

- **Source code** — [Apache License 2.0](LICENSE)
- **Pretrained weights** — [Epalea Model Weight License](pretrained/WEIGHT_LICENSE.md)

Commercial weight licensing: licensing@epalea.ai

## Citation

```bibtex
@article{epalea2026lpf,
  title  = {Epalea: Latent Factor Posteriors for Evidential Inference},
  author = {Epalea Team},
  year   = {2026},
  url    = {https://epalea.ai}
}
```

## Documentation

Full documentation at [epalea.ai/docs](https://epalea.ai/docs)

*Star the repository to follow progress.*
