PHP Classes


Recommend this page to a friend!
  Classes of Julian Finkler   Layerless   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Layerless
Assemble and process layerless neural networks
Author: By
Last change:
Date: 6 years ago
Size: 1,930 bytes


Class file image Download

GitHub tag Packagist Travis Packagist


Layerless is the new foundation of the legendary mind neural network project


composer require devtronic/layerless



// 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

echo $output->getOutput() . PHP_EOL; // 0.98545

// Back propagate
$target = 0;

$learningRate = 0.2;

// Re-Check

echo $output->getOutput() . PHP_EOL; // 0.92545