Visual network topoloy: Difference between revisions

From Artificial Neural Network for PHP
Line 16: Line 16:
$image = new ANN_NetworkGraph($network);
$image = new ANN_NetworkGraph($network);


$image->printImage();
$image->saveToFile('network.png');
</source>
</source>



Revision as of 19:09, 6 January 2008

PNG image of network topology

require_once 'ANN/ANN_Network.php';

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

$image = new ANN_NetworkGraph($network);

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

Output

Image of network toplogy