SlideShare a Scribd company logo
with PHP on a 
Symfony Console 
TicTacToe game 
Artificial 
Neural 
Networks
ANN with PHP SymfonyCon Madrid 2014 
Agenda 
1. Demo 
2. Symfony Console 
3. Symfony Console Helpers 
4. ANN Theory 
6. PHP + FANN 
7. Show me the code 
8. Demo 
9. Q&A
ANN with PHP SymfonyCon Madrid 2014 
Demo 
vs.
ANN with PHP SymfonyCon Madrid 2014 
Symfony Console
ANN with PHP SymfonyCon Madrid 2014 
Symfony Console - Installation 
bin/console 
#!/usr/bin/env php 
<?php 
require __DIR__ . ‘/../vendor/autoload.php'; 
use SymfonyComponentConsoleApplication; 
$app = new Application(); 
$app->run(); 
composer.json 
{ 
... 
"require": { 
"symfony/console": "~2.5" 
} 
... 
}
ANN with PHP SymfonyCon Madrid 2014 
Symfony Console - Installation 
bin/console 
#!/usr/bin/env php 
<?php 
require __DIR__ . ‘/../vendor/autoload.php'; 
use SymfonyComponentConsoleApplication; 
$app = new Application(); 
$app->run(); 
composer.json 
{ 
... 
"require": { 
"symfony/console": "~2.5" 
} 
... 
} 
$ php bin/console 
$ chmod +x bin/console 
$ bin/console
ANN with PHP SymfonyCon Madrid 2014
ANN with PHP SymfonyCon Madrid 2014 
Symfony console style guide 
https://github.com/symfony/symfony-docs/issues/4265 
Created by @javiereguiluz 
Improved by Symfony community
ANN with PHP SymfonyCon Madrid 2014 
Symfony Console Helpers 
Progress bar 
Table 
Question 
Formatter
ANN with PHP SymfonyCon Madrid 2014 
Command.php 
Progress bar 
<?php 
// create a new progress bar (10 units) 
$progress = new ProgressBar($output, 10); 
// start and displays the progress bar 
$progress->start(); 
$i = 0; 
while ($i++ < 10) { 
// ... do some work 
// advance the progress bar 1 unit 
$progress->advance(); 
} 
// ensure that the progress bar is at 100% 
$progress->finish();
ANN with PHP SymfonyCon Madrid 2014 
We all techies love progress bars
ANN with PHP SymfonyCon Madrid 2014 
Table 
Command.php 
<?php 
$table = new Table($output); 
$table 
->setHeaders(array('Component', 'Package')) 
->setRows(array( 
array('Console', 'symfony/console'), 
array('Form', 'symfony/form'), 
array('Finder', 'symfony/finder'), 
array('Config', 'symfony/config'), 
array('...', '...'), 
)) 
; 
$table->render();
ANN with PHP SymfonyCon Madrid 2014 
Question 
Command.php 
<?php 
$helper = $this->getHelper('question'); 
$question = new ConfirmationQuestion( 
'Dou you want to play again? ', 
false 
); 
if (!$helper->ask($input, $output, $question)) 
{ 
$output->writeln("Bye bye!"); 
return; 
} 
$output->writeln("Let's play again!");
ANN with PHP SymfonyCon Madrid 2014 
Formatter 
Command.php 
<?php 
$formatter = $this->getHelper('formatter'); 
$formattedLine = $formatter->formatSection( 
'Game finished', 
'Player one wins.' 
); 
$output->writeln($formattedLine); 
$errorMessages = array( 
'Error!', 
'Move already done.’ 
); 
$formattedBlock = $formatter 
->formatBlock($errorMessages, 'error'); 
$output->writeln($formattedBlock);
ANN with PHP SymfonyCon Madrid 2014 
Our helper
ANN with PHP SymfonyCon Madrid 2014 
Board 
Command.php 
<?php 
// Board example usage 
$board = new Board( 
$output, 
$this->getApplication() 
->getTerminalDimensions(), 
3, // Board size 
false // Don’t override the screen 
); 
// Update and display the board status 
$board->updateGame(0,0,1);
ANN with PHP SymfonyCon Madrid 2014 
Board 
Command.php 
<?php 
// Board example - four in a row 
$board = new BoardHelper( 
$output, 
$this->getApplication() 
->getTerminalDimensions(), 
4, // Board size 
false // Don’t override screen 
true // Board with backgrounded cells 
); 
// Update the board status (Player 1) 
$board->updateGame(0,0,1); 
// Update the board status (Player 2) 
$board->updateGame(0,1,2);
ANN with PHP SymfonyCon Madrid 2014 
Board 
Command.php 
<?php 
// Example TicTacToe with overwrite 
$board = new TicTacToeHelper( 
$output, 
$this->getApplication() 
->getTerminalDimensions(), 
3, // Board size 
true // Overwrite screen 
); 
// Update the board status and display 
$board->updateGame(1,1,1); 
$board->updateGame(0,0,2); 
$board->updateGame(2,0,1); 
$board->updateGame(0,2,2); 
$board->updateGame(0,1,1); 
$board->updateGame(2,1,2); 
$board->updateGame(1,0,1); 
$board->updateGame(1,2,2); 
$board->updateGame(2,2,1);
ANN with PHP SymfonyCon Madrid 2014 
Board 
Board.php 
<?php 
namespace PHPGamesConsoleHelper; 
class Board 
{ 
/** 
* @var SymfonyComponentConsoleOutputOutputInterface 
*/ 
private $output; 
/** 
* Clears the output buffer 
*/ 
private function clear() 
{ 
$this->output->write("e[2J"); 
} 
// ... 
Instruction that 
clears the screen
ANN with PHP SymfonyCon Madrid 2014 
There is a bonus helper
ANN with PHP SymfonyCon Madrid 2014 
Symfony Console - HAL 
Command.php 
<?php 
$hal = new HAL($output); 
$hal->sayHello();
ANN with PHP SymfonyCon Madrid 2014 
Artificial 
Neural 
Networks 
Computer model that intends to simulate how the brain works
ANN with PHP SymfonyCon Madrid 2014 
A typical ANN 
Input neuron 
Hidden neuron 
Output neuron 
Signal & weight
ANN with PHP SymfonyCon Madrid 2014 
Activation Functions 
Functions to process the input and produce a signal as output
ANN with PHP SymfonyCon Madrid 2014 
Activation Functions 
• Step - output is 0 or 1 
• Linear Combination - output is input sum plus 
a linear bias 
• Continuous Log-Sigmoid
ANN with PHP SymfonyCon Madrid 2014 
Activation Functions 
• Step - output is 0 or 1 
• Linear Combination - output is input sum plus 
a linear bias 
• Continuous Log-Sigmoid
ANN with PHP SymfonyCon Madrid 2014 
Activation Functions 
• Step - output is 0 or 1 
• Linear Combination - output is input sum plus 
a linear bias 
• Continuous Log-Sigmoid
ANN with PHP SymfonyCon Madrid 2014 
Backpropagation 
Backward propagation of errors 
Passes error signals backwards through the network during training to update the weights of the network
ANN with PHP SymfonyCon Madrid 2014 
ANN Types
ANN with PHP SymfonyCon Madrid 2014 
ANN types 
• Feedforward neural network 
Information goes only in one direction, forward. 
• Radial basis function network (RBF) 
Interpolation in multidimensional space. 
• Kohonen self-organizing network 
A set of artificial neurons learn to map points in an input space to 
coordinates in an output space.
ANN with PHP SymfonyCon Madrid 2014 
ANN types 
• Feedforward neural network 
Information goes only in one direction, forward. 
• Radial basis function network (RBF) 
Interpolation in multidimensional space. 
• Kohonen self-organizing network 
A set of artificial neurons learn to map points in an input space to 
coordinates in an output space.
ANN with PHP SymfonyCon Madrid 2014 
ANN types 
• Feedforward neural network 
Information goes only in one direction, forward. 
• Radial basis function network (RBF) 
Interpolation in multidimensional space. 
• Kohonen self-organizing network 
A set of artificial neurons learn to map points in an input space to 
coordinates in an output space.
ANN with PHP SymfonyCon Madrid 2014 
ANN Learning
ANN with PHP SymfonyCon Madrid 2014 
ANN Learning 
• Supervised 
• Unsupervised 
• Reinforcement
ANN with PHP SymfonyCon Madrid 2014 
ANN Learning 
• Supervised 
• Unsupervised 
• Reinforcement
ANN with PHP SymfonyCon Madrid 2014 
ANN Learning 
• Supervised 
• Unsupervised 
• Reinforcement
ANN with PHP SymfonyCon Madrid 2014 
We've used 
Reinforcement Learning 
With some slights adaptations to solve
ANN with PHP SymfonyCon Madrid 2014 
Temporal Credit Assignment 
Problem
ANN with PHP SymfonyCon Madrid 2014 
(WTF) ANN with 
What The Fann 
Artificial Neural Networks with PHP
ANN with PHP SymfonyCon Madrid 2014
ANN with PHP SymfonyCon Madrid 2014 
(WTF) ANN with 
Meet libfann & PECL fann 
$~> sudo apt-get install libfann; sudo pecl install fann
ANN with PHP SymfonyCon Madrid 2014 
(WTF) ANN with 
 OS X 
1. Install autoconf 
2. Install cmake 
3. Compile FANN 
4. Install php fann extension with PECL 
5. Add the extension to php.ini 
$ brew install autoconf
ANN with PHP SymfonyCon Madrid 2014 
(WTF) ANN with 
 OS X 
1. Install autoconf 
2. Install cmake 
3. Compile FANN 
4. Install php fann extension with PECL 
5. Add the extension to php.ini 
$ brew install cmake
ANN with PHP SymfonyCon Madrid 2014 
(WTF) ANN with 
 OS X 
1. Install autoconf 
2. Install cmake 
3. Compile FANN 
4. Install php fann extension with PECL 
5. Add the extension to php.ini 
$ cd FANN-2.2.X-Source 
$ cmake . 
$ sudo make install
ANN with PHP SymfonyCon Madrid 2014 
(WTF) ANN with 
 OS X 
1. Install autoconf 
2. Install cmake 
3. Compile FANN 
4. Install php fann extension with PECL 
5. Add the extension to php.ini 
$ sudo pecl install fann
ANN with PHP SymfonyCon Madrid 2014 
(WTF) ANN with 
 OS X 
1. Install autoconf 
2. Install cmake 
3. Compile FANN 
4. Install php fann extension with PECL 
5. Add the extension to php.ini 
extension=fann.so
ANN with PHP SymfonyCon Madrid 2014 
(WTF) ANN with 
Enjoy!
ANN with PHP SymfonyCon Madrid 2014 
(WTF) ANN with 
Show me the code!
ANN with PHP SymfonyCon Madrid 2014 
Demo 
vs.
ANN with PHP SymfonyCon Madrid 2014
ANN with PHP SymfonyCon Madrid 2014 
The two neurons behind this talk
ANN with PHP SymfonyCon Madrid 2014 
Eduardo Gulias 
@egulias 
• EmailValidator 
(Symfony >= 2.5, Drupal 8). 
• ListenersDebugCommandBundle 
(ezPublish 5). 
• PHPMad UG co-founder 
(Former Symfony Madrid). 
• Team leader at
ANN with PHP SymfonyCon Madrid 2014 
Ariel Ferrandini 
@aferrandini 
• Symfony simple password encoder 
service. (Symfony >=2.6). 
• Symfony DX application 
collaborator. 
• PHPMad UG co-founder. 
• Team leader at Paradigma 
Tecnológico
ANN with PHP SymfonyCon Madrid 2014 
Resources 
• Wikipedia (http://en.wikipedia.org/wiki/Artificial_neural_network) 
• Introduction for beginners (http://arxiv.org/pdf/cs/0308031.pdf) 
• Introduction to ANN (http://www.theprojectspot.com/tutorial-post/ 
introduction-to-artificial-neural-networks-part-1/7) 
• Reinforcement learning (http://www.willamette.edu/~gorr/classes/ 
cs449/Reinforcement/reinforcement0.html) 
• PHP FANN (http://www.php.net/fann)
ANN with PHP SymfonyCon Madrid 2014 
Resources 
• Repo PHPGames (https://github.com/phpgames/ANNTicTacToe) 
• Repo Board helper (https://github.com/phpgames/BoardHelper) 
• Repo HAL helper (https://github.com/phpgames/HALHelper)
ANN with PHP SymfonyCon Madrid 2014 
Thank you! 
https://joind.in/12951
ANN with PHP SymfonyCon Madrid 2014 
Questions? 
https://joind.in/12951

More Related Content

PDF
CLI, the other SAPI
PDF
clap: Command line argument parser for Pharo
PPT
Programming simple games with a raspberry pi and
PDF
RMOUG QEW Family Coding Event- Raspberry PI
PDF
GNU Parallel
PDF
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
ODP
Functional Pearls 4 (YAPC::EU::2009 remix)
PDF
Forward Swift 2017: Media Frameworks and Swift: This Is Fine
CLI, the other SAPI
clap: Command line argument parser for Pharo
Programming simple games with a raspberry pi and
RMOUG QEW Family Coding Event- Raspberry PI
GNU Parallel
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Functional Pearls 4 (YAPC::EU::2009 remix)
Forward Swift 2017: Media Frameworks and Swift: This Is Fine

Viewers also liked (20)

PPTX
Neural network & its applications
PPTX
Artificial neural network
PPTX
Introduction Of Artificial neural network
PDF
Compegence: Dr. Rajaram Kudli - An Introduction to Artificial Neural Network ...
PPT
Artificial neural network model & hidden layers in multilayer artificial neur...
PDF
Artificial neural networks
PPTX
Artificial neural network
PPT
Artificial neural network
PPTX
Artificial Neural Network(Artificial intelligence)
PDF
Artificial Neural Network Seminar - Google Brain
PPT
artificial neural network
PPTX
Neural network
PPTX
Artificial intelligence NEURAL NETWORKS
PPTX
Artificial Neural Network / Hand written character Recognition
PPTX
Artificial neural network
PPT
Artificial Intelligence: Artificial Neural Networks
PPTX
Handwritten character recognition using artificial neural network
PPTX
Neural networks
PPTX
neural network
PPTX
Nueral Network
Neural network & its applications
Artificial neural network
Introduction Of Artificial neural network
Compegence: Dr. Rajaram Kudli - An Introduction to Artificial Neural Network ...
Artificial neural network model & hidden layers in multilayer artificial neur...
Artificial neural networks
Artificial neural network
Artificial neural network
Artificial Neural Network(Artificial intelligence)
Artificial Neural Network Seminar - Google Brain
artificial neural network
Neural network
Artificial intelligence NEURAL NETWORKS
Artificial Neural Network / Hand written character Recognition
Artificial neural network
Artificial Intelligence: Artificial Neural Networks
Handwritten character recognition using artificial neural network
Neural networks
neural network
Nueral Network
Ad

Similar to Artificial Neural Network in a Tic Tac Toe Symfony Console Application - SymfonyCon 2014 (7)

PDF
Machine learning in php singapore
PDF
Machine learning in PHP
PDF
Machine learning in php las vegas
PDF
Machine learning in php php con poland
PDF
Artificial Neural Networks on a Tic Tac Toe console application
PDF
Machine learning in php
PPTX
Upstate CSCI 450 PHP Chapters 5, 12, 13
Machine learning in php singapore
Machine learning in PHP
Machine learning in php las vegas
Machine learning in php php con poland
Artificial Neural Networks on a Tic Tac Toe console application
Machine learning in php
Upstate CSCI 450 PHP Chapters 5, 12, 13
Ad

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
cuic standard and advanced reporting.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Cloud computing and distributed systems.
PDF
Machine learning based COVID-19 study performance prediction
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
KodekX | Application Modernization Development
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation_ Review paper, used for researhc scholars
cuic standard and advanced reporting.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Cloud computing and distributed systems.
Machine learning based COVID-19 study performance prediction
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
sap open course for s4hana steps from ECC to s4
KodekX | Application Modernization Development
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Per capita expenditure prediction using model stacking based on satellite ima...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Programs and apps: productivity, graphics, security and other tools
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Artificial Neural Network in a Tic Tac Toe Symfony Console Application - SymfonyCon 2014

  • 1. with PHP on a Symfony Console TicTacToe game Artificial Neural Networks
  • 2. ANN with PHP SymfonyCon Madrid 2014 Agenda 1. Demo 2. Symfony Console 3. Symfony Console Helpers 4. ANN Theory 6. PHP + FANN 7. Show me the code 8. Demo 9. Q&A
  • 3. ANN with PHP SymfonyCon Madrid 2014 Demo vs.
  • 4. ANN with PHP SymfonyCon Madrid 2014 Symfony Console
  • 5. ANN with PHP SymfonyCon Madrid 2014 Symfony Console - Installation bin/console #!/usr/bin/env php <?php require __DIR__ . ‘/../vendor/autoload.php'; use SymfonyComponentConsoleApplication; $app = new Application(); $app->run(); composer.json { ... "require": { "symfony/console": "~2.5" } ... }
  • 6. ANN with PHP SymfonyCon Madrid 2014 Symfony Console - Installation bin/console #!/usr/bin/env php <?php require __DIR__ . ‘/../vendor/autoload.php'; use SymfonyComponentConsoleApplication; $app = new Application(); $app->run(); composer.json { ... "require": { "symfony/console": "~2.5" } ... } $ php bin/console $ chmod +x bin/console $ bin/console
  • 7. ANN with PHP SymfonyCon Madrid 2014
  • 8. ANN with PHP SymfonyCon Madrid 2014 Symfony console style guide https://github.com/symfony/symfony-docs/issues/4265 Created by @javiereguiluz Improved by Symfony community
  • 9. ANN with PHP SymfonyCon Madrid 2014 Symfony Console Helpers Progress bar Table Question Formatter
  • 10. ANN with PHP SymfonyCon Madrid 2014 Command.php Progress bar <?php // create a new progress bar (10 units) $progress = new ProgressBar($output, 10); // start and displays the progress bar $progress->start(); $i = 0; while ($i++ < 10) { // ... do some work // advance the progress bar 1 unit $progress->advance(); } // ensure that the progress bar is at 100% $progress->finish();
  • 11. ANN with PHP SymfonyCon Madrid 2014 We all techies love progress bars
  • 12. ANN with PHP SymfonyCon Madrid 2014 Table Command.php <?php $table = new Table($output); $table ->setHeaders(array('Component', 'Package')) ->setRows(array( array('Console', 'symfony/console'), array('Form', 'symfony/form'), array('Finder', 'symfony/finder'), array('Config', 'symfony/config'), array('...', '...'), )) ; $table->render();
  • 13. ANN with PHP SymfonyCon Madrid 2014 Question Command.php <?php $helper = $this->getHelper('question'); $question = new ConfirmationQuestion( 'Dou you want to play again? ', false ); if (!$helper->ask($input, $output, $question)) { $output->writeln("Bye bye!"); return; } $output->writeln("Let's play again!");
  • 14. ANN with PHP SymfonyCon Madrid 2014 Formatter Command.php <?php $formatter = $this->getHelper('formatter'); $formattedLine = $formatter->formatSection( 'Game finished', 'Player one wins.' ); $output->writeln($formattedLine); $errorMessages = array( 'Error!', 'Move already done.’ ); $formattedBlock = $formatter ->formatBlock($errorMessages, 'error'); $output->writeln($formattedBlock);
  • 15. ANN with PHP SymfonyCon Madrid 2014 Our helper
  • 16. ANN with PHP SymfonyCon Madrid 2014 Board Command.php <?php // Board example usage $board = new Board( $output, $this->getApplication() ->getTerminalDimensions(), 3, // Board size false // Don’t override the screen ); // Update and display the board status $board->updateGame(0,0,1);
  • 17. ANN with PHP SymfonyCon Madrid 2014 Board Command.php <?php // Board example - four in a row $board = new BoardHelper( $output, $this->getApplication() ->getTerminalDimensions(), 4, // Board size false // Don’t override screen true // Board with backgrounded cells ); // Update the board status (Player 1) $board->updateGame(0,0,1); // Update the board status (Player 2) $board->updateGame(0,1,2);
  • 18. ANN with PHP SymfonyCon Madrid 2014 Board Command.php <?php // Example TicTacToe with overwrite $board = new TicTacToeHelper( $output, $this->getApplication() ->getTerminalDimensions(), 3, // Board size true // Overwrite screen ); // Update the board status and display $board->updateGame(1,1,1); $board->updateGame(0,0,2); $board->updateGame(2,0,1); $board->updateGame(0,2,2); $board->updateGame(0,1,1); $board->updateGame(2,1,2); $board->updateGame(1,0,1); $board->updateGame(1,2,2); $board->updateGame(2,2,1);
  • 19. ANN with PHP SymfonyCon Madrid 2014 Board Board.php <?php namespace PHPGamesConsoleHelper; class Board { /** * @var SymfonyComponentConsoleOutputOutputInterface */ private $output; /** * Clears the output buffer */ private function clear() { $this->output->write("e[2J"); } // ... Instruction that clears the screen
  • 20. ANN with PHP SymfonyCon Madrid 2014 There is a bonus helper
  • 21. ANN with PHP SymfonyCon Madrid 2014 Symfony Console - HAL Command.php <?php $hal = new HAL($output); $hal->sayHello();
  • 22. ANN with PHP SymfonyCon Madrid 2014 Artificial Neural Networks Computer model that intends to simulate how the brain works
  • 23. ANN with PHP SymfonyCon Madrid 2014 A typical ANN Input neuron Hidden neuron Output neuron Signal & weight
  • 24. ANN with PHP SymfonyCon Madrid 2014 Activation Functions Functions to process the input and produce a signal as output
  • 25. ANN with PHP SymfonyCon Madrid 2014 Activation Functions • Step - output is 0 or 1 • Linear Combination - output is input sum plus a linear bias • Continuous Log-Sigmoid
  • 26. ANN with PHP SymfonyCon Madrid 2014 Activation Functions • Step - output is 0 or 1 • Linear Combination - output is input sum plus a linear bias • Continuous Log-Sigmoid
  • 27. ANN with PHP SymfonyCon Madrid 2014 Activation Functions • Step - output is 0 or 1 • Linear Combination - output is input sum plus a linear bias • Continuous Log-Sigmoid
  • 28. ANN with PHP SymfonyCon Madrid 2014 Backpropagation Backward propagation of errors Passes error signals backwards through the network during training to update the weights of the network
  • 29. ANN with PHP SymfonyCon Madrid 2014 ANN Types
  • 30. ANN with PHP SymfonyCon Madrid 2014 ANN types • Feedforward neural network Information goes only in one direction, forward. • Radial basis function network (RBF) Interpolation in multidimensional space. • Kohonen self-organizing network A set of artificial neurons learn to map points in an input space to coordinates in an output space.
  • 31. ANN with PHP SymfonyCon Madrid 2014 ANN types • Feedforward neural network Information goes only in one direction, forward. • Radial basis function network (RBF) Interpolation in multidimensional space. • Kohonen self-organizing network A set of artificial neurons learn to map points in an input space to coordinates in an output space.
  • 32. ANN with PHP SymfonyCon Madrid 2014 ANN types • Feedforward neural network Information goes only in one direction, forward. • Radial basis function network (RBF) Interpolation in multidimensional space. • Kohonen self-organizing network A set of artificial neurons learn to map points in an input space to coordinates in an output space.
  • 33. ANN with PHP SymfonyCon Madrid 2014 ANN Learning
  • 34. ANN with PHP SymfonyCon Madrid 2014 ANN Learning • Supervised • Unsupervised • Reinforcement
  • 35. ANN with PHP SymfonyCon Madrid 2014 ANN Learning • Supervised • Unsupervised • Reinforcement
  • 36. ANN with PHP SymfonyCon Madrid 2014 ANN Learning • Supervised • Unsupervised • Reinforcement
  • 37. ANN with PHP SymfonyCon Madrid 2014 We've used Reinforcement Learning With some slights adaptations to solve
  • 38. ANN with PHP SymfonyCon Madrid 2014 Temporal Credit Assignment Problem
  • 39. ANN with PHP SymfonyCon Madrid 2014 (WTF) ANN with What The Fann Artificial Neural Networks with PHP
  • 40. ANN with PHP SymfonyCon Madrid 2014
  • 41. ANN with PHP SymfonyCon Madrid 2014 (WTF) ANN with Meet libfann & PECL fann $~> sudo apt-get install libfann; sudo pecl install fann
  • 42. ANN with PHP SymfonyCon Madrid 2014 (WTF) ANN with  OS X 1. Install autoconf 2. Install cmake 3. Compile FANN 4. Install php fann extension with PECL 5. Add the extension to php.ini $ brew install autoconf
  • 43. ANN with PHP SymfonyCon Madrid 2014 (WTF) ANN with  OS X 1. Install autoconf 2. Install cmake 3. Compile FANN 4. Install php fann extension with PECL 5. Add the extension to php.ini $ brew install cmake
  • 44. ANN with PHP SymfonyCon Madrid 2014 (WTF) ANN with  OS X 1. Install autoconf 2. Install cmake 3. Compile FANN 4. Install php fann extension with PECL 5. Add the extension to php.ini $ cd FANN-2.2.X-Source $ cmake . $ sudo make install
  • 45. ANN with PHP SymfonyCon Madrid 2014 (WTF) ANN with  OS X 1. Install autoconf 2. Install cmake 3. Compile FANN 4. Install php fann extension with PECL 5. Add the extension to php.ini $ sudo pecl install fann
  • 46. ANN with PHP SymfonyCon Madrid 2014 (WTF) ANN with  OS X 1. Install autoconf 2. Install cmake 3. Compile FANN 4. Install php fann extension with PECL 5. Add the extension to php.ini extension=fann.so
  • 47. ANN with PHP SymfonyCon Madrid 2014 (WTF) ANN with Enjoy!
  • 48. ANN with PHP SymfonyCon Madrid 2014 (WTF) ANN with Show me the code!
  • 49. ANN with PHP SymfonyCon Madrid 2014 Demo vs.
  • 50. ANN with PHP SymfonyCon Madrid 2014
  • 51. ANN with PHP SymfonyCon Madrid 2014 The two neurons behind this talk
  • 52. ANN with PHP SymfonyCon Madrid 2014 Eduardo Gulias @egulias • EmailValidator (Symfony >= 2.5, Drupal 8). • ListenersDebugCommandBundle (ezPublish 5). • PHPMad UG co-founder (Former Symfony Madrid). • Team leader at
  • 53. ANN with PHP SymfonyCon Madrid 2014 Ariel Ferrandini @aferrandini • Symfony simple password encoder service. (Symfony >=2.6). • Symfony DX application collaborator. • PHPMad UG co-founder. • Team leader at Paradigma Tecnológico
  • 54. ANN with PHP SymfonyCon Madrid 2014 Resources • Wikipedia (http://en.wikipedia.org/wiki/Artificial_neural_network) • Introduction for beginners (http://arxiv.org/pdf/cs/0308031.pdf) • Introduction to ANN (http://www.theprojectspot.com/tutorial-post/ introduction-to-artificial-neural-networks-part-1/7) • Reinforcement learning (http://www.willamette.edu/~gorr/classes/ cs449/Reinforcement/reinforcement0.html) • PHP FANN (http://www.php.net/fann)
  • 55. ANN with PHP SymfonyCon Madrid 2014 Resources • Repo PHPGames (https://github.com/phpgames/ANNTicTacToe) • Repo Board helper (https://github.com/phpgames/BoardHelper) • Repo HAL helper (https://github.com/phpgames/HALHelper)
  • 56. ANN with PHP SymfonyCon Madrid 2014 Thank you! https://joind.in/12951
  • 57. ANN with PHP SymfonyCon Madrid 2014 Questions? https://joind.in/12951