Metadata-Version: 2.1
Name: neuroflex
Version: 0.1.3
Summary: An advanced neural network framework with interpretability, generalization, robustness, and fairness features
Home-page: https://github.com/VishwamAI/neuroflex
Author: kasinadhsarma
Author-email: kasinadhsarma@gmail.com
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
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: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: absl-py
Requires-Dist: adversarial-robustness-toolbox
Requires-Dist: aiohappyeyeballs
Requires-Dist: aiohttp
Requires-Dist: aiosignal
Requires-Dist: alphafold
Requires-Dist: appdirs
Requires-Dist: astunparse
Requires-Dist: attrs
Requires-Dist: autograd
Requires-Dist: autoray
Requires-Dist: biom-format
Requires-Dist: biopython==1.80
Requires-Dist: blosc2
Requires-Dist: cachetools
Requires-Dist: certifi
Requires-Dist: charset-normalizer
Requires-Dist: chex==0.1.6
Requires-Dist: CHSPy
Requires-Dist: click==8.0.4
Requires-Dist: contextlib2
Requires-Dist: deap
Requires-Dist: decorator
Requires-Dist: dill
Requires-Dist: dm-haiku==0.0.9
Requires-Dist: dm-sonnet
Requires-Dist: dm-tree
Requires-Dist: docker
Requires-Dist: dpath
Requires-Dist: ete3
Requires-Dist: etils
Requires-Dist: filelock
Requires-Dist: flatbuffers
Requires-Dist: flax==0.6.10
Requires-Dist: frozenlist
Requires-Dist: fsspec
Requires-Dist: gast<=0.4.0,>=0.2.1
Requires-Dist: google-pasta
Requires-Dist: grpcio
Requires-Dist: gym
Requires-Dist: h5py
Requires-Dist: huggingface-hub
Requires-Dist: humanize
Requires-Dist: idna
Requires-Dist: immutabledict
Requires-Dist: importlib_resources
Requires-Dist: iniconfig
Requires-Dist: jax==0.4.13
Requires-Dist: jaxlib==0.4.13
Requires-Dist: Jinja2
Requires-Dist: jitcdde
Requires-Dist: jitcxde_common
Requires-Dist: jmp
Requires-Dist: joblib
Requires-Dist: keras<2.13,>=2.12.0
Requires-Dist: lale==0.6.0
Requires-Dist: libclang
Requires-Dist: lightning-utilities
Requires-Dist: llvmlite
Requires-Dist: Markdown
Requires-Dist: markdown-it-py
Requires-Dist: MarkupSafe
Requires-Dist: mdurl
Requires-Dist: ml-collections
Requires-Dist: ml-dtypes
Requires-Dist: mpmath
Requires-Dist: msgpack
Requires-Dist: multidict
Requires-Dist: namex
Requires-Dist: natsort
Requires-Dist: ndindex
Requires-Dist: nest-asyncio
Requires-Dist: networkx
Requires-Dist: neurolib
Requires-Dist: numba
Requires-Dist: numexpr
Requires-Dist: numpy==1.23.5
Requires-Dist: nvidia-cublas-cu11
Requires-Dist: nvidia-cuda-cupti-cu11
Requires-Dist: nvidia-cuda-nvrtc-cu11
Requires-Dist: nvidia-cuda-runtime-cu11
Requires-Dist: nvidia-cudnn-cu11
Requires-Dist: nvidia-cufft-cu11
Requires-Dist: nvidia-curand-cu11
Requires-Dist: nvidia-cusolver-cu11
Requires-Dist: nvidia-cusparse-cu11
Requires-Dist: nvidia-nccl-cu11
Requires-Dist: nvidia-nvtx-cu11
Requires-Dist: openmm==8.1.1
Requires-Dist: opt-einsum
Requires-Dist: optax==0.1.5
Requires-Dist: optree
Requires-Dist: orbax-checkpoint==0.2.1
Requires-Dist: packaging
Requires-Dist: pandas
Requires-Dist: patsy
Requires-Dist: pbr
Requires-Dist: PennyLane==0.30.0
Requires-Dist: PennyLane_Lightning==0.30.0
Requires-Dist: pluggy
Requires-Dist: protobuf==3.20.3
Requires-Dist: psutil
Requires-Dist: py-cpuinfo
Requires-Dist: Pygments
Requires-Dist: pypet
Requires-Dist: pytest
Requires-Dist: python-dateutil
Requires-Dist: pytorch-lightning==1.9.5
Requires-Dist: pytz
Requires-Dist: PyYAML
Requires-Dist: qiskit>=1.0.0
Requires-Dist: qiskit-aer>=0.12.0
Requires-Dist: qiskit-algorithms>=0.2.0
Requires-Dist: regex
Requires-Dist: requests
Requires-Dist: rich
Requires-Dist: rustworkx>=0.13.0
Requires-Dist: safetensors
Requires-Dist: scikit-bio<0.6.0,>=0.5.8
Requires-Dist: scikit-learn==1.1.1
Requires-Dist: scipy==1.9.0
Requires-Dist: six
Requires-Dist: statsmodels
Requires-Dist: stevedore
Requires-Dist: symengine
Requires-Dist: sympy
Requires-Dist: tables
Requires-Dist: tabulate
Requires-Dist: tensorboard<2.13,>=2.12
Requires-Dist: tensorboard-data-server
Requires-Dist: tensorflow==2.12.0
Requires-Dist: tensorflow-io-gcs-filesystem
Requires-Dist: tensorstore
Requires-Dist: termcolor
Requires-Dist: threadpoolctl
Requires-Dist: tokenizers==0.13.3
Requires-Dist: toml
Requires-Dist: toolz
Requires-Dist: torch==1.13.1
Requires-Dist: torchmetrics
Requires-Dist: torchvision==0.14.1
Requires-Dist: tqdm
Requires-Dist: transformers==4.30.2
Requires-Dist: triton==2.0.0
Requires-Dist: typing_extensions<4.6.0,>=3.7.4
Requires-Dist: tzdata
Requires-Dist: urllib3
Requires-Dist: Werkzeug
Requires-Dist: wrapt
Requires-Dist: xarray
Requires-Dist: yarl
Requires-Dist: zipp
Requires-Dist: PyQt5
Requires-Dist: einops
Requires-Dist: prophet
Requires-Dist: psutil
Requires-Dist: aif360
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: flake8; extra == "dev"

# NeuroFlex: Advanced Neural Network Framework (v0.1.3)

NeuroFlex is a cutting-edge neural network framework built on JAX, Flax, and TensorFlow, designed to address key challenges in modern machine learning: interpretability, generalization, robustness, and fairness. This project integrates state-of-the-art techniques and methodologies for creating more transparent, reliable, and ethical AI systems.

![NeuroFlex Architecture](neuroflex-architecture-svg.svg)

## Key Features

- **Advanced Neural Architectures**: Support for CNN, RNN, LSTM, GAN, and Spiking Neural Networks.
- **Multi-Backend Integration**: Seamless integration with JAX, Flax, and TensorFlow.
- **2D and 3D Convolutions**: Efficient implementation of both 2D and 3D convolutional layers.
- **Quantum Computing**: Quantum Neural Network module for next-generation AI.
- **Reinforcement Learning**: Advanced capabilities with enhanced self-curing algorithms.
- **Brain-Computer Interface (BCI)**: Cutting-edge integration for neurotechnology applications.
- **Ethical AI**: Fairness constraints and bias mitigation techniques.
- **Robustness**: Improved adversarial training, interpretability tools (SHAP), and adaptive learning rate adjustment.
- **Bioinformatics**: AlphaFold integration for protein structure prediction and drug discovery.
- **Generative AI**: Creative problem-solving and content generation.
- **Natural Language Processing**: Sentence piece integration and advanced NLP tasks.
- **Neuromorphic Computing**: Energy-efficient spiking neural networks.
- **Self-Healing**: Advanced diagnostic and healing processes for improved model performance and stability.
- **Consciousness Simulation**: Integration of **Integrated Information Theory (IIT)** and **Global Workspace Theory (GWT)** for advanced consciousness modeling.
  
## Latest Updates (v0.1.3)

- **Consciousness Simulation**: Achieved integration of **Integrated Information Theory (IIT)** and **Global Workspace Theory (GWT)** for cognitive and consciousness modeling.
- TensorFlow Integration: Added support for TensorFlow backend alongside JAX/Flax.
- 2D and 3D Convolutions: Implemented efficient convolutional layers for both 2D and 3D inputs.
- Enhanced Compatibility: Improved interoperability between JAX/Flax and TensorFlow.
- Comprehensive Testing: Developed and passed pytest tests for all components, including TensorFlow integration.
- Enhanced self-curing mechanism with adaptive learning rate adjustment.
- Improved model robustness against gradient explosions and local minima.
- Advanced diagnostic checks for model performance and training issues.
- Whisper API integration for advanced speech recognition.
- Enhanced AlphaFold integration for protein structure prediction.
- Support for Python 3.9, 3.10, 3.11, 3.12.
- Resolved dependency issues and improved stability.

## Installation

```bash
pip install neuroflex
```

## Quick Start Guide

1. **Import NeuroFlex**

```python
from neuroflex import NeuroFlexNN, train_model, create_neuroflex_nn
```

2. **Define Your Model**

```python
model = create_neuroflex_nn(
    features=[64, 32, 10],
    input_shape=(1, 28, 28, 1),
    output_shape=(1, 10),
    use_cnn=True,
    conv_dim=2,
    backend='tensorflow'  # or 'jax' for JAX/Flax backend
)
```

3. **Train Your Model**

```python
trained_state, trained_model = train_model(
    model, train_data, val_data,
    num_epochs=10, batch_size=32, learning_rate=1e-3
)
```

4. **Make Predictions**

```python
predictions = trained_model(test_data)
```

## Advanced Usage

### TensorFlow Convolutions

```python
from neuroflex import TensorFlowConvolutions

tf_conv = TensorFlowConvolutions(
    features=(32, 64, 128),
    input_shape=(1, 28, 28, 1),
    conv_dim=2  # Use 3 for 3D convolutions
)
model = tf_conv.create_model()
```

### JAX/Flax and TensorFlow Compatibility

```python
from neuroflex.utils import convert_array

jax_array = jax.random.uniform(jax.random.PRNGKey(0), shape=(1, 28, 28, 1))
tf_tensor = convert_array(jax_array, 'tensorflow')
```

### Adversarial Training

```python
from neuroflex import adversarial_training

perturbed_data = adversarial_training(model, params, input_data, epsilon=0.1, step_size=0.01)
```

## Testing

We have developed comprehensive pytest tests for all components, including the TensorFlow integration. To run the tests:

```bash
pytest tests/
```

Key test files:
- `test_neuroflex_nn.py`: Tests for the core NeuroFlexNN functionality.
- `test_tensorflow_convolutions.py`: Tests for TensorFlow convolution implementations.

## Environment Setup

NeuroFlex supports multiple operating systems:
- Ubuntu
- Windows
- macOS

To set up your environment:

1. Clone the repository:
   ```bash
   git clone https://github.com/neuroflex/neuroflex.git
   ```
2. Create a virtual environment:
   ```bash
   python -m venv neuroflex-env
   ```
3. Activate the environment:
   - Ubuntu/macOS: `source neuroflex-env/bin/activate`
   - Windows: `neuroflex-env\Scripts\activate`
4. Install dependencies:
   ```bash
   pip install -r requirements.txt
   ```

## Documentation and Project Structure

The NeuroFlex project is organized into several key directories and files, each serving a specific purpose:

- **NeuroFlex.py**: Integrates various AI and neural network components, providing a unified interface for core neural networks, quantum neural networks, ethical frameworks, explainable AI, BCI integration, consciousness simulation, protein structure prediction, and more.
- **Prompt_Agent**: Contains agentic behavior models and related functionalities.
- **Transformers**: Includes advanced transformer models for text processing and classification.
- **Advanced Models**: Contains advanced math solving, time series analysis, and multi-modal learning models.
- **AI Ethics**: Implements ethical frameworks and guidelines for AI, including explainable AI and self-curing algorithms.
- **BCI Integration**: Facilitates integration with brain-computer interfaces, providing tools for BCI data processing and neuroscience model integration.
- **Cognitive Architectures**: Implements advanced cognitive architectures with self-healing mechanisms and adaptive algorithms.
- **Config**: Contains configuration files and constants for the project.
- **Core Neural Networks**: Provides core neural network models and functionalities.
- **Edge AI**: Focuses on edge AI optimization and deployment.
- **Generative Models**: Includes models for generative AI and creative problem-solving.
- **Main.py**: Demonstrates various components of the NeuroFlex framework.
- **Model Monitoring**: Contains tools for monitoring and analyzing model performance and health.
- **NeuroFlex Integration**: Integrates various components of the NeuroFlex system.
- **Threat Detection**: Provides methods for detecting and analyzing threats using anomaly detection, deep learning, and pattern recognition.
- **Utils**: Offers utility functions for data handling, preprocessing, and analysis.

For detailed documentation, including API references and tutorials, visit our [official documentation](https://neuroflex.readthedocs.io).

## Contributing

We welcome contributions! Please see our [contributing guidelines](CONTRIBUTING.md) for more information on how to get started.

## License

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

## Citation

If you use NeuroFlex in your research, please cite:

```bibtex
@software{neuroflex2024,
  author = {kasinadhsarma},
  title = {NeuroFlex: Advanced Neural Network Framework},
  year = {2024},
  url = {https://github.com/VishwamAI/NeuroFlex}
}
```

## Contact

For questions, feedback, or support, please open an issue on our [GitHub repository](https://github.com/VishwamAI/NeuroFlex/issues) or contact us at [REDACTED].

---

### **Changes**:
- Added **Consciousness Simulation** section under Key Features and Latest Updates to reflect the integration of **IIT** and **GWT** theories.
- Updated the version to **v0.1.3**.
- General improvements and formatting to ensure clarity and consistency with the latest features.
