forked from BrainJS/brain.js
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Minor fix for future compatibility of using
CrossValidate
with…
… other neural networks Bump version number, and as well bump bower version number
- Loading branch information
1 parent
b2bec1e
commit 5797b87
Showing
12 changed files
with
49 additions
and
53 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -31,5 +31,5 @@ | |
"node_modules", | ||
"test" | ||
], | ||
"version": "1.1.1" | ||
"version": "1.3.1" | ||
} |
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* license: MIT (http://opensource.org/licenses/MIT) | ||
* author: Heather Arthur <[email protected]> | ||
* homepage: https://github.com/brainjs/brain.js#readme | ||
* version: 1.3.0 | ||
* version: 1.3.1 | ||
* | ||
* acorn: | ||
* license: MIT (http://opensource.org/licenses/MIT) | ||
|
@@ -127,17 +127,18 @@ var CrossValidate = function () { | |
/** | ||
* | ||
* @param {NeuralNetwork|constructor} Classifier | ||
* @param {object} [options] | ||
*/ | ||
function CrossValidate(Classifier) { | ||
function CrossValidate(Classifier, options) { | ||
_classCallCheck(this, CrossValidate); | ||
|
||
this.Classifier = Classifier; | ||
this.options = options; | ||
this.json = null; | ||
} | ||
|
||
/** | ||
* | ||
* @param {object} options | ||
* @param {object} trainOpts | ||
* @param {object} trainSet | ||
* @param {object} testSet | ||
|
@@ -147,8 +148,8 @@ var CrossValidate = function () { | |
|
||
_createClass(CrossValidate, [{ | ||
key: "testPartition", | ||
value: function testPartition(options, trainOpts, trainSet, testSet) { | ||
var classifier = new this.Classifier(options); | ||
value: function testPartition(trainOpts, trainSet, testSet) { | ||
var classifier = new this.Classifier(this.options); | ||
var beginTrain = Date.now(); | ||
var trainingStats = classifier.train(trainSet, trainOpts); | ||
var beginTest = Date.now(); | ||
|
@@ -188,7 +189,6 @@ var CrossValidate = function () { | |
/** | ||
* | ||
* @param {object} data | ||
* @param {object} options | ||
* @param {object} trainOpts | ||
* @param {number} [k] | ||
* @returns { | ||
|
@@ -214,7 +214,7 @@ var CrossValidate = function () { | |
|
||
}, { | ||
key: "train", | ||
value: function train(data, options, trainOpts, k) { | ||
value: function train(data, trainOpts, k) { | ||
k = k || 4; | ||
var size = data.length / k; | ||
|
||
|
@@ -291,8 +291,8 @@ var CrossValidate = function () { | |
}; | ||
} | ||
}, { | ||
key: "toNetwork", | ||
value: function toNetwork() { | ||
key: "toNeuralNetwork", | ||
value: function toNeuralNetwork() { | ||
return this.fromJSON(this.json); | ||
} | ||
}, { | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "brain.js", | ||
"description": "Neural network library", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"author": "Heather Arthur <[email protected]>", | ||
"repository": { | ||
"type": "git", | ||
|
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
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