PHP Classes
elePHPant
Icontem

Layerless: Assemble and process layerless neural networks

Recommend this page to a friend!
  Info   View files Documentation   View files View files (21)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-06-25 (1 month ago) RSS 2.0 feedNot enough user ratingsTotal: 41 This week: 3All time: 8,925 This week: 249Up
Version License PHP version Categories
layerless 1.0.0Custom (specified...5PHP 5, Artificial intelligence
Description Author

This package can assemble and process layerless neural networks.

It can assemble different types of neurons with initial values and connect them using synapses.

It can also use the back propagate algorithm to adjust neuron weights by setting target values on the output neurons and recheck the values again.

  Performance   Level  
Name: Julian Finkler <contact>
Classes: 2 packages by
Country: Germany Germany

Details

GitHub tag Packagist Travis Packagist

Layerless

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

Installation

composer require devtronic/layerless

Usage

<?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 folder image Files  
File Role Description
Files folder imagesrc (4 files, 1 directory)
Files folder imagetests (5 files, 1 directory)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imageActivator (4 files)
  Plain text file BiasNeuron.php Class Class source
  Plain text file InputNeuron.php Class Class source
  Plain text file Neuron.php Class Class source
  Plain text file Synapse.php Class Class source

  Files folder image Files  /  src  /  Activator  
File Role Description
  Plain text file ActivatorInterface.php Class Class source
  Plain text file SigmoidActivator.php Class Class source
  Plain text file SinusActivator.php Class Class source
  Plain text file TanHActivator.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageActivator (3 files)
  Accessible without login Plain text file autoload.php Aux. Auxiliary script
  Plain text file BiasNeuronTest.php Class Class source
  Plain text file InputNeuronTest.php Class Class source
  Plain text file NeuronTest.php Class Class source
  Plain text file SynapseTest.php Class Class source

  Files folder image Files  /  tests  /  Activator  
File Role Description
  Plain text file SigmoidActivatorTest.php Class Class source
  Plain text file SinusActivatorTest.php Class Class source
  Plain text file TanHActivatorTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:41
This week:3
All time:8,925
This week:249Up