Created
August 8, 2016 13:45
-
-
Save robertleeplummerjr/ea2fa21deb7929fecd8d69f39a367055 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| //current code | |
| var h0 = this.multiply(hiddenMatrix.weight, inputVector, this); | |
| var h1 = this.multiply(hiddenMatrix.transition, hiddenPrev, this); | |
| var hiddenD = this.relu(this.add(this.add(h0, h1, this), hiddenMatrix.bias, this), this); | |
| //psuedo strongeryly typed relationship of above code | |
| hiddenMatrix.weight.next = inputVector; | |
| hiddenMatrix.weight.action = multiply; | |
| hiddenMatrix.transition.next = hiddenPrev; | |
| hiddenMatrix.transition.action = multiply; | |
| inputVector.next = hiddenPrev; | |
| inputVector.action = add; | |
| hiddenPrev.next = hiddenMatrix.bias; | |
| hiddenPrev.action = add; | |
| hidden.next = null; | |
| hidden.action = relu; | |
| function run(matrix) { | |
| while (matrix.next !== null) { | |
| matrix.action(matrix, matrix.next); | |
| matrix = matrix.next; | |
| } | |
| if (matrix.action) { | |
| matrix.action(); | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment