amended chaos-synth-mlp example

nix
Pierre Alexandre Tremblay 6 years ago
parent deaac85ec9
commit 3c036f32d3

@ -22,13 +22,6 @@ f = Slider2D(w,Rect(420,10,300, 300));
f.x = 0.5;
f.y = 0.5;
f.action = {arg x,y; //if trained, predict the point f.x f.y
if (trained == 1, {
input.setn(0, [f.x, f.y]);
mlp.predictPoint(input,output,0,{
output.getn(0,10,{
|x|va = x; b.set(\val, va); {a.value = va;}.defer;});
});
});
if (entering == 1, { //if entering a point, add to the the database f.x f.y against the array va
input.setn(0, [f.x, f.y]);
output.setn(0, va);
@ -38,6 +31,13 @@ f.action = {arg x,y; //if trained, predict the point f.x f.y
entry = entry + 1;
{d.value = 0;}.defer;
});
if (trained == 1, {
input.setn(0, [f.x, f.y]);
mlp.predictPoint(input,output,0,{
output.getn(0,10,{
|x|va = x; b.set(\val, va); {a.value = va;}.defer;});
});
});
};
c = Button(w, Rect(730,240,50, 20)).states_([["train", Color.red, Color.white], ["trained", Color.white, Color.grey]]).action_{

Loading…
Cancel
Save