Skip to content

Commit

Permalink
link var for bg
Browse files Browse the repository at this point in the history
index.html/?level=1&bg=X
1 for white gb
0 for blueisch
  • Loading branch information
fsewing committed Mar 4, 2024
1 parent 27e5085 commit 9144f3f
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions SandwichNet/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var learningRateMax = 20;
var learningRateStep = 0.1;

let level = 2;

let bg = 0;
let oldInputNodes;
let oldHiddenNodes;
let oldOutputNodes;
Expand All @@ -52,6 +52,8 @@ function preload() {
const urlParams = new URLSearchParams(queryString);
level = urlParams.get('level')
print("jump to Level " + level);
bg = urlParams.get('bg')
print("set bg to " + bg);
}
else
{
Expand Down Expand Up @@ -104,7 +106,13 @@ function setup()

sandwichNet = new SimpleNeuralNet(inputNodes, hiddenNodes, outputNodes, netW, netH);
sandwichNet.forward(v);
background(230,255,255);
if(bg == 1)
{
background(255);
}
else{
background(230,255,255);
}
sandwichNet.update(netW,netH);

//errorGraph = new ErrorGraph(w,50);
Expand Down Expand Up @@ -145,7 +153,13 @@ if(oldInputNodes != inputNodes || oldHiddenNodes != hiddenNodes || oldOutputNode
}

offsetTrainButton = netW/2;
background(230,255,255);
if(bg == 1)
{
background(255);
}
else{
background(230,255,255);
}
sandwichNet.update();
sandwichNet.changeWeightsOnClick();
push();
Expand Down

0 comments on commit 9144f3f

Please sign in to comment.