2017 © Pedro Peláez
 

library layerless

Layerless Neural Network

image

devtronic/layerless

Layerless Neural Network

  • Saturday, June 10, 2017
  • by Devtronic
  • Repository
  • 1 Watchers
  • 1 Stars
  • 49 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

GitHub tag Packagist Travis Packagist, (*1)

Layerless

Layerless is the new foundation of the legendary mind neural network project, (*2)

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

The Versions

10/06 2017

dev-master

9999999-dev

Layerless Neural Network

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Julian Finkler

10/06 2017

v1.0

1.0.0.0

Layerless Neural Network

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Julian Finkler