Visual network topoloy: Difference between revisions

From Artificial Neural Network for PHP
 
(3 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
{
{
$network = 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;
}
}


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


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



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