-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
112,378 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
class Button | ||
{ | ||
constructor(w,h) | ||
{ | ||
this.buttonWidth = w; | ||
this.buttonHeight = h; | ||
this.buttonPos = createVector(); | ||
} | ||
isPressed(position) | ||
{ | ||
if(mouseIsPressed === true) | ||
{ | ||
this.buttonPos = position; | ||
if( (translatedMouseX >= this.buttonPos.x) && | ||
(translatedMouseX <= this.buttonPos.x + this.buttonWidth) && | ||
(translatedMouseY >= this.buttonPos.y) && | ||
(translatedMouseY <= this.buttonPos.y + this.buttonHeight) | ||
) | ||
{ | ||
return true; | ||
}else{ | ||
return false; | ||
} | ||
} | ||
} | ||
render(position) | ||
{ | ||
this.buttonPos = position; | ||
push(); | ||
translate(this.buttonPos.x,this.buttonPos.y); | ||
rectMode(CORNER); | ||
fill(255); | ||
stroke(2); | ||
rect(0,0,this.buttonWidth,this.buttonWidth) | ||
pop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
class ErrorGraph | ||
{ | ||
constructor(w,h) | ||
{ | ||
this.numPoints = [1,0.5,0.2]; | ||
this.h = h; | ||
this.w = w; | ||
} | ||
|
||
update(newNumber) | ||
{ | ||
this.numPoints.push(newNumber); | ||
} | ||
|
||
render() | ||
{ | ||
stroke(0); | ||
strokeWeight(2); | ||
// draw ellipses | ||
line(0,1,this.w,1); | ||
line(0,this.h,this.w,this.h); | ||
if(this.numPoints.length != 0) | ||
{ | ||
for(let i = 0; i < this.numPoints.length; i++) | ||
{ | ||
let x = i * (this.w / (this.numPoints.length-1)); | ||
let y = map(this.numPoints[i],0,1,0,this.w); | ||
fill(0); | ||
ellipse(x, y, 7); | ||
} | ||
stroke(0); | ||
// draw lines | ||
let px = 0; | ||
let py = randomY[0]; | ||
for(let i =0; i < this.numPoints.length; i++) | ||
{ | ||
let x = i * (width / (this.numPoints.length-1)); | ||
let y = randomY[i]; | ||
line(px, py, x, y); | ||
|
||
//store the last position | ||
px = x; | ||
py = y; | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
let debugging = false; | ||
|
||
function debug(v) | ||
{ | ||
if(debugging == true) | ||
{ | ||
console.log(v); | ||
} | ||
} | ||
|
||
function getRandomInt(max) | ||
{ | ||
return Math.round((Math.random() * 2 * max) - max); | ||
} | ||
function getRandomTestInput() | ||
{ | ||
return Math.round((Math.random())); | ||
} | ||
|
||
function create_1d_array(rows) | ||
{ | ||
let array_1d = new Array(rows); | ||
for(let i = 0; i < rows; i++) | ||
{ | ||
array_1d[i] = 0; | ||
} | ||
return array_1d; | ||
} | ||
|
||
function create_1d_classArray(rows, Val) | ||
{ | ||
let array_1d = new Array(rows); | ||
for(let i = 0; i < rows; i++) | ||
{ | ||
array_1d[i] = new Val(); | ||
} | ||
return array_1d; | ||
} | ||
|
||
function create_2d_array(rows, columns) | ||
{ | ||
let array_2d = new Array(rows); | ||
for(let i = 0; i < rows; i++) | ||
{ | ||
array_2d[i] = new Array(columns); | ||
for(let j = 0; j < columns; j++) | ||
{ | ||
array_2d[i][j] = getRandomInt(3)+0.5; | ||
} | ||
} | ||
return array_2d; | ||
} | ||
|
||
function create_2d_boolArray(rows, columns) | ||
{ | ||
let array_2d = new Array(rows); | ||
for(let i = 0; i < rows; i++) | ||
{ | ||
array_2d[i] = new Array(columns); | ||
for(let j = 0; j < columns; j++) | ||
{ | ||
array_2d[i][j] = false; | ||
} | ||
} | ||
return array_2d; | ||
} | ||
|
||
function create_1d_vectorArray(rows) | ||
{ | ||
let array_1d = new Array(rows); | ||
for(let i = 0; i < rows; i++) | ||
{ | ||
array_1d[i] = createVector(0,0); | ||
} | ||
return array_1d; | ||
} | ||
|
||
function create_2d_vectorArray(rows, columns) | ||
{ | ||
let array_2d = new Array(rows); | ||
for(let i = 0; i < rows; i++) | ||
{ | ||
array_2d[i] = new Array(columns); | ||
for(let j = 0; j < columns; j++) | ||
{ | ||
array_2d[i][j] = createVector(0,0); | ||
} | ||
} | ||
return array_2d; | ||
} |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js"></script> | ||
<link rel="stylesheet" type="text/css" href="style.css"> | ||
<meta charset="utf-8" /> | ||
|
||
</head> | ||
<body> | ||
<main> | ||
</main> | ||
<script src="quicksettings.js"></script> | ||
<script src="p5.gui.js"></script> | ||
<script src="helper.js"></script> | ||
<script src="sandwich.js"></script> | ||
<script src="button.js"></script> | ||
<script src="tasteOMeter.js"></script> | ||
<!--<script src="errorGraph.js"></script>--> | ||
<script src="sigmoidGraph.js"></script> | ||
<script src="simpleNeuralNet.js"></script> | ||
<script src="sketch.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.