Skip to content

ramos-papadopoulos/Dann-p5

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

versionNpmStat repoSize downloadNpmStat GitHub

p5js graphics for Dannjs

Display any Dann model & customize themes!



CDN

<script src="https://raw.githubusercontent.com/matiasvlevi/Dann-p5/v0.0.1/build/dannp5.min.js"></script>

Getting started

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();
}

Socials

IMAGE image image

Licence

MIT

About

p5js graphics for Dannjs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.1%
  • HTML 0.9%