Metadata-Version: 2.4
Name: deepparameters
Version: 2.0.0
Summary: Advanced Neural Network CPD Learning with LSTM, BNN, VAE, Normalizing Flows, and more - Major 2.0 Release with 9 Architectures and 8 Sampling Methods
Project-URL: Homepage, https://github.com/deepparameters/deepparameters
Project-URL: Documentation, https://deepparameters.readthedocs.io/
Project-URL: Repository, https://github.com/deepparameters/deepparameters.git
Project-URL: Bug Tracker, https://github.com/deepparameters/deepparameters/issues
Project-URL: Changelog, https://github.com/deepparameters/deepparameters/blob/main/CHANGELOG.md
Author-email: DeepParameters Development Team <deepparameters@example.com>
Maintainer-email: DeepParameters Development Team <deepparameters@example.com>
License: MIT
License-File: LICENSE
Keywords: autoencoder,bayesian networks,bnn,cpd,deep learning,lstm,machine learning,neural networks,normalizing flows,probabilistic modeling,vae
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: build>=1.2.2.post1
Requires-Dist: matplotlib>=3.5.0
Requires-Dist: networkx>=2.6.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: pandas>=1.3.0
Requires-Dist: pgmpy>=0.1.19
Requires-Dist: scikit-learn>=1.0.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: seaborn>=0.11.0
Requires-Dist: tabulate>=0.9.0
Requires-Dist: tensorflow-probability>=0.15.0
Requires-Dist: tensorflow>=2.8.0
Requires-Dist: twine>=6.1.0
Provides-Extra: dev
Requires-Dist: black>=22.0; extra == 'dev'
Requires-Dist: flake8>=4.0; extra == 'dev'
Requires-Dist: ipykernel>=6.0.0; extra == 'dev'
Requires-Dist: isort>=5.0; extra == 'dev'
Requires-Dist: jupyter>=1.0.0; extra == 'dev'
Requires-Dist: jupyterlab>=3.0.0; extra == 'dev'
Requires-Dist: mypy>=0.950; extra == 'dev'
Requires-Dist: pytest-cov>=2.0; extra == 'dev'
Requires-Dist: pytest>=6.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-parser>=0.17; extra == 'docs'
Requires-Dist: sphinx-rtd-theme>=1.0; extra == 'docs'
Requires-Dist: sphinx>=4.0; extra == 'docs'
Provides-Extra: examples
Requires-Dist: jupyterlab>=3.0.0; extra == 'examples'
Requires-Dist: notebook>=6.0.0; extra == 'examples'
Description-Content-Type: text/markdown

# DeepParameters

**Advanced Neural Network CPD Learning for Bayesian Networks**
*Version 2.0.0 - Major Release*

DeepParameters is a comprehensive Python package for learning Conditional Probability Distributions (CPDs) using state-of-the-art neural network architectures. It provides a unified interface for experimenting with various deep learning approaches to probabilistic modeling.

> 🎉 **Version 2.0.0** brings significant improvements: 9 neural architectures, 8 sampling methods, enhanced performance (26.5%-41.7% improvement), and production-ready stability!

## 🚀 Key Features

- **9 Neural Network Architectures**: Simple NN, Advanced NN, LSTM, Autoencoder, VAE, BNN, Normalizing Flow, Ultra, Mega
- **8 Sampling Methods**: Gibbs, Metropolis-Hastings, Importance, BPE, Variational, HMC, and more
- **Comprehensive Evaluation**: 7 performance metrics including MAE, KL divergence, and probability consistency
- **Simple Interface**: Unified `learn_cpd_for_node()` function for all architectures
- **Production Ready**: Extensive documentation, error handling, and validation

## 📦 Installation

```bash
pip install deepparameters
# For the latest 2.0.0 features:
pip install --upgrade deepparameters
```

### What's New in 2.0.0

- **9 Neural Architectures**: From simple feedforward to advanced VAE and Normalizing Flows
- **8 Sampling Methods**: Comprehensive probabilistic inference toolkit
- **Performance Boost**: 26.5% to 41.7% improvement over previous versions
- **Enhanced Stability**: Production-ready with extensive error handling
- **Better Documentation**: Complete workflow guides and migration assistance

For upgrading from earlier versions, see our [CHANGELOG.md](CHANGELOG.md) for migration details.

## 🎯 Quick Start

```python
from deepparameters import learn_cpd_for_node
import pandas as pd
from pgmpy.models import BayesianNetwork

# Load your data
data = pd.read_csv('your_data.csv')

# Define your Bayesian network structures
true_model = BayesianNetwork([('A', 'B'), ('C', 'B')])
learnt_model = BayesianNetwork([('A', 'B'), ('C', 'B')])

# Learn CPD with default settings
cpd = learn_cpd_for_node(
    node='B', 
    data=data, 
    true_model=true_model, 
    learnt_bn_structure=learnt_model,
    num_parameters=10
)

# Advanced usage with custom architecture and sampling
cpd = learn_cpd_for_node(
    node='B',
    data=data,
    true_model=true_model,
    learnt_bn_structure=learnt_model,
    num_parameters=20,
    network_type='lstm',           # Try: simple, advanced, lstm, autoencoder, vae, bnn
    sampling_method='4',           # Try: 1-8 for different sampling methods
    epochs=200,
    verbose=True
)
```

## 🏗️ Architecture Overview

### Neural Network Architectures

| Architecture | Description | Best For |
|-------------|-------------|----------|
| `simple` | Basic feedforward network | Quick prototyping |
| `advanced` | Multi-layer with dropout and batch norm | General purpose |
| `lstm` | Long Short-Term Memory network | Sequential dependencies |
| `autoencoder` | Encoder-decoder architecture | Feature learning |
| `vae` | Variational Autoencoder | Probabilistic modeling |
| `bnn` | Bayesian Neural Network | Uncertainty quantification |
| `normalizing_flow` | Normalizing Flow model | Complex distributions |
| `ultra` | Advanced hybrid architecture | High-performance scenarios |
| `mega` | Maximum complexity architecture | Research applications |

### Sampling Methods

| Method | ID | Description | Strengths |
|--------|-------|-------------|-----------|
| Gibbs | `1` | Gibbs sampling | Simple, reliable |
| Metropolis-Hastings | `2` | MCMC sampling | Flexible |
| Importance | `3` | Importance sampling | Efficient for rare events |
| BPE | `4` | Belief Propagation Extension | Fast inference |
| Variational | `5` | Variational inference | Scalable |
| HMC | `8` | Hamiltonian Monte Carlo | High accuracy |

## 📊 Performance Evaluation

DeepParameters provides comprehensive evaluation metrics:

- **Mean Absolute Error (MAE)**: Primary accuracy metric
- **KL Divergence**: Distribution similarity measure  
- **Root Mean Square Error (RMSE)**: Error magnitude
- **Maximum Error**: Worst-case performance
- **JS Divergence**: Symmetric distribution distance
- **Cosine Similarity**: Directional similarity
- **Probability Consistency**: Probabilistic validity

```python
from deepparameters import evaluate_cpd_performance

# Evaluate learned CPD against ground truth
results = evaluate_cpd_performance(learned_cpd, true_cpd)
print(f"MAE: {results['mean_absolute_error']:.4f}")
print(f"KL Divergence: {results['kl_divergence']:.4f}")
```

## 🔧 Advanced Configuration

```python
# Full parameter configuration
cpd = learn_cpd_for_node(
    node='B',
    data=data,
    true_model=true_model,
    learnt_bn_structure=learnt_model,
    num_parameters=50,
    network_type='vae',
    sampling_method='8',
    epochs=500,
    batch_size=64,
    learning_rate=0.001,
    validation_split=0.2,
    early_stopping=True,
    verbose=True,
    random_state=42
)
```

## 📚 Documentation

- **[Complete Workflow Guide](DEEPPARAMETERS_WORKFLOW_GUIDE.md)**: Step-by-step usage examples
- **[Performance Analysis](PERFORMANCE_ANALYSIS_REPORT.md)**: Detailed benchmarks and comparisons
- **[API Reference](DOCUMENTATION_INDEX.md)**: Complete function documentation

## 🧪 Example Workflows

Check out these example files in the repository:

- `deepparameters_workflow_example.py`: Complete workflow demonstration
- `bayesian_network_cpd_demonstration.py`: Live CPD learning examples
- `enhanced_deepparameters_demo.py`: Advanced usage patterns

## ⚡ Performance Benchmarks

Based on extensive testing with version 2.0.0:

- **Overall Improvement**: 26.5% to 41.7% better than version 0.0.6
- **Success Rate**: 66.7% across all 9 architectures
- **Best Performing**: VAE (41.7% improvement) and Normalizing Flow architectures
- **Fastest**: Simple NN and Advanced NN (26.5% improvement)
- **Most Accurate**: BNN and Ultra architectures for complex scenarios
- **Production Ready**: Enhanced error handling and validation across all methods

## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🎓 Citation

If you use DeepParameters in your research, please cite:

```bibtex
@software{deepparameters2024,
  title={DeepParameters: Advanced Neural Network CPD Learning},
  author={DeepParameters Development Team},
  year={2024},
  url={https://github.com/deepparameters/deepparameters}
}
```

## 🆘 Support

- **Documentation**: [GitHub Wiki](https://github.com/deepparameters/deepparameters/wiki)
- **Issues**: [GitHub Issues](https://github.com/deepparameters/deepparameters/issues)
- **Discussions**: [GitHub Discussions](https://github.com/deepparameters/deepparameters/discussions)

---

**DeepParameters** - Making advanced CPD learning accessible to everyone.
