Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 76 | All time: 10,170 This week: 455 |
Version | License | PHP version | Categories | |||
layerless 1.0.0 | Custom (specified... | 5 | PHP 5, Artificial intelligence |
Description | Author | |
This package can assemble and process layerless neural networks. |
Layerless is the new foundation of the legendary mind neural network project
composer require devtronic/layerless
<?php
// Import the SinusActivator as Activator
use Devtronic\Layerless\Activator\SinusActivator as Activator;
use Devtronic\Layerless\BiasNeuron;
use Devtronic\Layerless\InputNeuron;
use Devtronic\Layerless\Neuron;
use Devtronic\Layerless\Synapse;
// Load Composer autoload
require_once __DIR__ . '/vendor/autoload.php';
// Create the activator
$activator = new Activator();
// Create 2 Input Neurons and 1 Bias Neuron
$inputA = new InputNeuron(1);
$inputB = new InputNeuron(0);
$bias = new BiasNeuron(1);
// Create 1 Output Neuron
$output = new Neuron($activator);
// Connect the neurons
new Synapse(0.90, $inputA, $output);
new Synapse(0.23, $inputB, $output);
new Synapse(0.50, $bias, $output);
// Activate the neurons
$inputA->activate();
$inputB->activate();
$output->activate();
echo $output->getOutput() . PHP_EOL; // 0.98545
// Back propagate
$target = 0;
$output->calculateDelta($target);
$inputA->calculateDelta();
$inputB->calculateDelta();
$learningRate = 0.2;
$output->updateWeights($learningRate);
$inputA->updateWeights($learningRate);
$inputB->updateWeights($learningRate);
// Re-Check
$inputA->activate();
$inputB->activate();
$output->activate();
echo $output->getOutput() . PHP_EOL; // 0.92545
Files (21) |
File | Role | Description | ||
---|---|---|---|---|
src (4 files, 1 directory) | ||||
tests (5 files, 1 directory) | ||||
.travis.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
phpunit.xml | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files (21) | / | src |
File | Role | Description | ||
---|---|---|---|---|
Activator (4 files) | ||||
BiasNeuron.php | Class | Class source | ||
InputNeuron.php | Class | Class source | ||
Neuron.php | Class | Class source | ||
Synapse.php | Class | Class source |
Files (21) | / | src | / | Activator |
File | Role | Description |
---|---|---|
ActivatorInterface.php | Class | Class source |
SigmoidActivator.php | Class | Class source |
SinusActivator.php | Class | Class source |
TanHActivator.php | Class | Class source |
Files (21) | / | tests |
File | Role | Description | ||
---|---|---|---|---|
Activator (3 files) | ||||
autoload.php | Aux. | Auxiliary script | ||
BiasNeuronTest.php | Class | Class source | ||
InputNeuronTest.php | Class | Class source | ||
NeuronTest.php | Class | Class source | ||
SynapseTest.php | Class | Class source |
Files (21) | / | tests | / | Activator |
File | Role | Description |
---|---|---|
SigmoidActivatorTest.php | Class | Class source |
SinusActivatorTest.php | Class | Class source |
TanHActivatorTest.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.