dnn icon indicating copy to clipboard operation
dnn copied to clipboard

[BUG] LogisticRegression Final Cross Entropy : NaN

Open tusharmath opened this issue 11 years ago • 0 comments

In the following scenario we are getting an invalid (NaN) value for final cross entropy

var dnn = require('dnn');
// Training set
var x = [
    [0, 1],
    [0, 1],
    [0, 1],
    [1, 0],
    [1, 0],
    [1, 0],
];
var y = [
    [1],
    [1],
    [1],
    [1],
    [1],
    [1]
];

var lrClassifier = new dnn.LogisticRegression({
    'input': x,
    'label': y,
    'n_in': 2,
    'n_out': 1
});

// lrClassifier.set('log level', 0); // 0 : nothing, 1 : info, 2 : warning.
lrClassifier.train({});

x = [
    [0, 0],
    [0, 0],
    [0, 0],
    [1, 1],
    [1, 1],
    [1, 1],
];

console.log("Result : ", lrClassifier.predict(x));

tusharmath avatar Feb 27 '15 10:02 tusharmath