Visual network topoloy: Difference between revisions

From Artificial Neural Network for PHP
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:


<source lang="php">
<source lang="php">
require_once 'ANN/ANN_Loader.php';
require_once 'ANN/Loader.php';

use ANN\Network;
use ANN\NetworkGraph;


try
try
{
{
$objNetwork = ANN_Network::loadFromFile('xor.dat');
$objNetwork = Network::loadFromFile('xor.dat');
}
}
catch(Exception $e)
catch(Exception $e)
{
{
print 'Network not found';
die('Network not found');

exit;
}
}


$objNetworkImage = new ANN_NetworkGraph($objNetwork);
$objNetworkImage = new NetworkGraph($objNetwork);


$objNetworkImage->saveToFile('network.png');
$objNetworkImage->saveToFile('network.png');

Latest revision as of 12:12, 1 June 2011

PNG image of network topology

require_once 'ANN/Loader.php';

use ANN\Network;
use ANN\NetworkGraph;

try
{
  $objNetwork = Network::loadFromFile('xor.dat');
}
catch(Exception $e)
{
  die('Network not found');
}

$objNetworkImage = new NetworkGraph($objNetwork);

$objNetworkImage->saveToFile('network.png');

Output

Image of network toplogy