PHPackages                             golivehost/brain - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. golivehost/brain

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

golivehost/brain
================

A comprehensive PHP neural network library with support for various network architectures

v1.0.0(11mo ago)3273MITPHPPHP &gt;=8.0

Since Apr 10Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/golivehost/brain)[ Packagist](https://packagist.org/packages/golivehost/brain)[ RSS](/packages/golivehost-brain/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

GoLiveHost Brain
================

[](#golivehost-brain)

A comprehensive PHP neural network library for machine learning and artificial intelligence applications.

**Developed by:** Go Live Web Solutions ([golive.host](https://golive.host))
**Author:** Shubhdeep Singh ([GitHub.com/shubhdeepdev](https://github.com/shubhdeepdev))

> ⚠️ **IMPORTANT NOTE**
> The examples provided are for demonstration purposes only and are trained on very limited datasets.
> The outputs may not be accurate or reliable for real-world applications.
> **For production use**, you must train models on larger, representative datasets and thoroughly validate their performance before deployment.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Features](#features)
- [Quick Start](#quick-start)
- [Neural Network Types](#neural-network-types)
- [Advanced Features](#advanced-features)
- [Configuration Options](#configuration-options)
- [Examples](#examples)
- [API Reference](#api-reference)
- [Contributing](#contributing)
- [License](#license)

Installation
------------

[](#installation)

Install via Composer:

```
composer require golivehost/brain
```

Features
--------

[](#features)

### Neural Network Architectures

[](#neural-network-architectures)

- **Feedforward Neural Network** - Traditional multi-layer perceptron
- **Recurrent Neural Network (RNN)** - For sequential data processing
- **Long Short-Term Memory (LSTM)** - Advanced RNN with memory cells
- **Gated Recurrent Unit (GRU)** - Simplified LSTM variant
- **Liquid State Machine (LSM)** - Reservoir computing for complex temporal patterns

### Training Features

[](#training-features)

- **Multiple Optimization Algorithms**
    - Stochastic Gradient Descent (SGD) with momentum
    - Adam optimizer
    - RMSprop optimizer
    - AdaGrad optimizer
- **Advanced Training Options**
    - Batch training with configurable batch sizes
    - Learning rate decay
    - Dropout regularization
    - Early stopping with patience
    - Gradient clipping
    - Model checkpointing
- **Activation Functions**
    - Sigmoid
    - Tanh
    - ReLU
    - Leaky ReLU
    - Softmax
    - Linear

### Data Processing

[](#data-processing)

- **Preprocessing Utilities**
    - Data normalization
    - Data formatting for sequences
    - One-hot encoding
- **Evaluation Tools**
    - Cross-validation (k-fold, stratified k-fold, leave-one-out)
    - Train-test split
    - Multiple evaluation metrics (MSE, RMSE, R², accuracy, precision, recall, F1)
- **Model Management**
    - Model serialization (JSON)
    - Model export to standalone PHP
    - Model checkpointing during training

### Additional Features

[](#additional-features)

- **Batch Normalization** - For improved training stability
- **Matrix and Tensor Operations** - Comprehensive mathematical utilities
- **Model Validation** - Input validation and error handling
- **GPU Support Consideration** - Architecture designed for future GPU acceleration
- **PHP 8.0+ Compatibility** - Modern PHP features and type safety

Quick Start
-----------

[](#quick-start)

### Basic Neural Network (XOR Problem)

[](#basic-neural-network-xor-problem)

```
