Visual network topoloy: Difference between revisions

From Artificial Neural Network for PHP
Line 6: Line 6:
try
try
{
{
$network = ANN_Network::loadFromFile('xor.dat');
$objNetwork = ANN_Network::loadFromFile('xor.dat');
}
}
catch(Exception $e)
catch(Exception $e)
{
{
print 'Network not found';
print 'Network not found';

exit;
exit;
}
}


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


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



Revision as of 12:52, 18 December 2008

PNG image of network topology

require_once 'ANN/ANN_Loader.php';

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

  exit;
}

$objNetworkImage = new ANN_NetworkGraph($objNetwork);

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

Output

Image of network toplogy