24hoursmedia / php-fann-topology-visualization
visualizations for a FANN topology
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Open Issues: 4
pkg:composer/24hoursmedia/php-fann-topology-visualization
Requires
- php: >=5.6
- 24hoursmedia/php-fann-topology-core: master-dev
This package is auto-updated.
Last update: 2020-04-30 15:16:07 UTC
README
This component visualizes a FANN neural network using D3JS. The visualization shows nodes and their connections to eachother.
Negative connections are shown in red, positive in green. The thickness and brightness of the connection is an indicator of it's strength.
To create a visualization, you can configure a visitor that can visit the FANN topology:
use T4\Fann\Topology\Core\Topology; use T4\Fann\Topology\Core\Neuron; use T4\Fann\Topology\Visualization\D3J\D3JsNeuronVisitor; $ann = ....; // your fann neural network resource $topology = Topology::createFromFann($ann); $visitor = D3JsNeuronVisitor(); // configure visitor here; here the node is given a name $visitor->setNamingCallback(function(Neuron $n) { return 'node #' . $n; }); // visit and get the collected data for configuring d3js foreach ($topology->getNeurons() as $k => $neuron) { $neuron->accept($visitor); } $data = $visitor->getJsonData(); // @TODO: include in a template