Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mateogianolio committed Feb 29, 2016
1 parent 8193466 commit 4f46e7a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions examples/logistic-regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@

// perform row-wise softmax on matrix
function softmax(m) {
var r = m.shape[0],
c = m.shape[1],
var c = m.shape[1],
max = new Vector(m).max(),
sum = 0,
exp;
sum;

return m.map(function (x, i, j) {
if (j === 0) {
Expand All @@ -27,10 +25,9 @@
});
}

// get row-wise mean of matrix as vector
// get col-wise mean of matrix as vector
function mean(m) {
var r = m.shape[0],
c = m.shape[1],
var c = m.shape[1],
v = Vector.zeros(c),
sum;

Expand All @@ -43,7 +40,7 @@
});
}

// add vector to matrix
// row-wise add vector to matrix
function addMatVec(m, v) {
return m.map(function (x, r, c) {
return x + v.get(c);
Expand All @@ -69,8 +66,9 @@
]);

var W = Matrix.zeros(X.shape[0], y.shape[1]),
b = Vector.zeros(y.shape[1]),
rate = 0.01,
b = Vector.zeros(y.shape[1]);

var rate = 0.01,
prob,
delta;

Expand Down

0 comments on commit 4f46e7a

Please sign in to comment.