Difference between revisions of "Installation"

From Artificial Neural Network for PHP
 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== ANN - Artificial Neural Network for PHP 5.x ==
+
== ANN - Artificial Neural Network for PHP ==
   
 
This chapter describes the steps to implement the ANN source code to your project.
 
This chapter describes the steps to implement the ANN source code to your project.
   
  +
== Documentation ==
  +
  +
* [http://ann.thwien.de/phpdoc/ Documentation (HTML online)]
  +
  +
== Requirements ==
  +
  +
The latest implementation requires a php environment running '''PHP 5.4.x''' or above. If using the client-server mechanism of the network class, the '''curl extension''' should be available on the client host which connects to an ANN server. If using class ''ANN_NetworkGraph'' '''GD library with png support''' should be installed.
   
 
== Installation ==
 
== Installation ==
  +
  +
* [[Download]] the source code
  +
  +
* Checking integrity
  +
  +
>md5sum ann230*
   
 
* Unpack the source code
 
* Unpack the source code
   
>tar -xzf ann200.tar.gz
+
>tar -xzf ann230.tar.gz
   
 
* Copy the directory ANN to your library directory of your project.
 
* Copy the directory ANN to your library directory of your project.
Line 17: Line 30:
 
<?php
 
<?php
   
require_once ('ANN/ANN_Network.php');
+
require_once 'ANN/Loader.php';
   
  +
use ANN\Network;
$ann = new ANN_Network;
 
   
  +
$objNetwork = new Network;
?>
 
  +
</source>
  +
  +
'''or''' as phar library (supported as of PHP 5.3.0)
  +
  +
<source lang="php">
  +
<?php
  +
  +
require_once 'phar://ann230.phar.gz';
  +
  +
use ANN\Network;
  +
  +
$objNetwork = new Network;
 
</source>
 
</source>
   
 
* Learn to use the library. Have a look to chapter [[Examples]].
 
* Learn to use the library. Have a look to chapter [[Examples]].
  +
  +
* For further information e.g. about dat-files have a view to the [[FAQ]] page.
  +
  +
== Performance issues ==
  +
  +
* Install Zend Optimizer (PHP version before 5.3.0)
  +
* Do not use any debugger module like xdebug
  +
* Do not use any profiling tool
  +
* Do not set "max_execution_time = 0" in your php.ini or .htaccess file
  +
* Running PHP on Linux console use "php -d max_execution_time=60 neural.php"
  +
* Run implicit ini_set() call to set "max_execution_time" by runtime
  +
* Use PHP 5.3.x
  +
* Use PHP 5.4.x (much faster than PHP 5.3.x)

Latest revision as of 11:34, 27 November 2020

ANN - Artificial Neural Network for PHP

This chapter describes the steps to implement the ANN source code to your project.

Documentation

Requirements

The latest implementation requires a php environment running PHP 5.4.x or above. If using the client-server mechanism of the network class, the curl extension should be available on the client host which connects to an ANN server. If using class ANN_NetworkGraph GD library with png support should be installed.

Installation

  • Checking integrity
>md5sum ann230*
  • Unpack the source code
>tar -xzf ann230.tar.gz
  • Copy the directory ANN to your library directory of your project.
  • Including to your source
<?php

require_once 'ANN/Loader.php';

use ANN\Network;

$objNetwork = new Network;

or as phar library (supported as of PHP 5.3.0)

<?php

require_once 'phar://ann230.phar.gz';

use ANN\Network;

$objNetwork = new Network;
  • Learn to use the library. Have a look to chapter Examples.
  • For further information e.g. about dat-files have a view to the FAQ page.

Performance issues

  • Install Zend Optimizer (PHP version before 5.3.0)
  • Do not use any debugger module like xdebug
  • Do not use any profiling tool
  • Do not set "max_execution_time = 0" in your php.ini or .htaccess file
  • Running PHP on Linux console use "php -d max_execution_time=60 neural.php"
  • Run implicit ini_set() call to set "max_execution_time" by runtime
  • Use PHP 5.3.x
  • Use PHP 5.4.x (much faster than PHP 5.3.x)