PHPackages                             patrickschur/neural-network - 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. patrickschur/neural-network

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

patrickschur/neural-network
===========================

A dead simple neural network. For educational purposes only.

v0.1(9y ago)10503MITPHPPHP ^7

Since Feb 19Pushed 7y ago3 watchersCompare

[ Source](https://github.com/patrickschur/neural-network)[ Packagist](https://packagist.org/packages/patrickschur/neural-network)[ Docs](https://github.com/patrickschur/neural-network)[ RSS](/packages/patrickschur-neural-network/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

neural-network
==============

[](#neural-network)

[![Build Status](https://camo.githubusercontent.com/3665b8cb147fd0c7f25a910c2a437f66b084f9f1faadf64c71041d4652267e19/68747470733a2f2f7472617669732d63692e6f72672f7061747269636b73636875722f6e657572616c2d6e6574776f726b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/patrickschur/neural-network)[![codecov](https://camo.githubusercontent.com/aa8dbebc78bd6c87c69481a596c855ddbdfdfa1f63934c729f9838aa39d2b7e6/68747470733a2f2f636f6465636f762e696f2f67682f7061747269636b73636875722f6e657572616c2d6e6574776f726b2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/patrickschur/neural-network)[![Version](https://camo.githubusercontent.com/6e33ff76b8a612088609bcc4a22fec540cc703f99987a2758811d54fabf8da70/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7061747269636b73636875722f6e657572616c2d6e6574776f726b2e7376673f7374796c653d666c61742d706c6173746963)](https://packagist.org/packages/patrickschur/neural-network)[![Minimum PHP Version](https://camo.githubusercontent.com/5447464135d2116ef14d99ff979c0f8d9aa8ab53e06c9ce10c0b4745b87b1bed/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e302d6565343439392e7376673f7374796c653d666c61742d706c6173746963)](http://php.net/)[![License](https://camo.githubusercontent.com/e2776537d8f618ad33bee493ee80b695f523719578b75175795a2ba2d5ed7544/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7061747269636b73636875722f6e657572616c2d6e6574776f726b2e7376673f7374796c653d666c61742d706c6173746963)](https://opensource.org/licenses/MIT)

A dead simple neural network. For educational purposes only. Ported from Java into PHP. Originally written in Java from [Brotcrunsher](https://youtube.com/brotcrunsher) a German youtuber who makes tutorials about computer science.

> **Note**: The project is still under construction and can change at any time

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

[](#installation)

```
$ composer require patrickschur/neural-network
```

Examples
--------

[](#examples)

Creating a simple single-layer perceptron network with four inputs and one output neuron.

```
// Creates the neural network
$nn = new NeuralNetwork();

// Creates four input neurons
$i1 = $nn->createNewInput();
$i2 = $nn->createNewInput();
$i3 = $nn->createNewInput();
$i4 = $nn->createNewInput();

// Sets the input for each input neuron
$i1->setValue(1);
$i2->setValue(2);
$i3->setValue(3);
$i4->setValue(4);

// Creates the output neuron
$o1 = $nn->createNewOutput(new Identity());

// Sets the weights and connect each input to the output neuron
$nn->createFullMesh(0, 0, 0, 0);

echo $o1->getValue(); // Output 0
```

[![Screenshot](screenshots/singlelayer.png)](screenshots/singlelayer.png)

Contribute
----------

[](#contribute)

Feel free to contribute. Any help is welcome.

License
-------

[](#license)

This project is licensed under the terms of the MIT license.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3417d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18181635?v=4)[Patrick Schur](/maintainers/patrickschur)[@patrickschur](https://github.com/patrickschur)

---

Top Contributors

[![patrickschur](https://avatars.githubusercontent.com/u/18181635?v=4)](https://github.com/patrickschur "patrickschur (5 commits)")

---

Tags

deep-learningfeedforward-neural-networkmachine-learningneural-networkneural-network-examplephpmachine learningneural-networkDeep learning

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/patrickschur-neural-network/health.svg)

```
[![Health](https://phpackages.com/badges/patrickschur-neural-network/health.svg)](https://phpackages.com/packages/patrickschur-neural-network)
```

###  Alternatives

[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.5M28](/packages/rubix-ml)[php-ai/php-ml

PHP-ML - Machine Learning library for PHP

1061.8M13](/packages/php-ai-php-ml)[nlp-tools/nlp-tools

NlpTools is a set of php 5.3+ classes for beginner to semi advanced natural language processing work.

764664.2k5](/packages/nlp-tools-nlp-tools)[davmixcool/php-sentiment-analyzer

PHP Sentiment Analyzer is a lexicon and rule-based sentiment analysis tool that is used to understand sentiments in a sentence using VADER (Valence Aware Dictionary and sentiment Reasoner).

134167.1k1](/packages/davmixcool-php-sentiment-analyzer)[codewithkyrian/transformers

State-of-the-art Machine Learning for PHP. Run Transformers in PHP

757254.8k7](/packages/codewithkyrian-transformers)[rindow/rindow-neuralnetworks

Neural networks library for deep learning

8511.3k](/packages/rindow-rindow-neuralnetworks)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
