Display any Dann model & customize themes!
<script src="https://raw.githubusercontent.com/matiasvlevi/Dann-p5/v0.0.1/build/dannp5.min.js"></script>
Setup a graph for a model.
// Create Dann model
let nn = new Dann(4, 4);
nn.addHiddenLayer(12);
nn.makeWeights();
let graph;
function setup() {
createCanvas(600, 600);
// Graph at: x:10 y:10 w:200 h:125
graph = new NetGraph(10, 10, 200, 125);
graph.setModel(nn);
}
function draw() {
background(51);
// Show on screen
graph.show();
}
Here is how you can customize the graphs's theme:
// Create Dann model
let nn = new Dann(2, 1);
nn.addHiddenLayer(12);
nn.makeWeights();
let graph;
function setup() {
createCanvas(600, 600);
// Graph at: x:10 y:10 w:200 h:125
graph = new NetGraph(10, 10, 200, 125);
graph.setMode(FIXED);
graph.setSpacing(16);
graph.setTheme(ROBOT);
graph.setModel(nn);
}
function draw() {
background(51);
// Show on screen
graph.show();
}
MIT