Skip to content

[BUG] LogisticRegression Final Cross Entropy : NaN #2

@tusharmath

Description

@tusharmath

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));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions