Skip to content

Commit

Permalink
Merge pull request #133 from BrainJS/v1.0.3-prep
Browse files Browse the repository at this point in the history
V1.0.3 prep
  • Loading branch information
robertleeplummerjr committed Jan 26, 2018
2 parents c58765c + 872a7d2 commit 166c0f5
Show file tree
Hide file tree
Showing 25 changed files with 299 additions and 110 deletions.
20 changes: 20 additions & 0 deletions ISSUE_TEMPLATE.md
@@ -0,0 +1,20 @@
<!-- If you don't mind add a fun gif or meme, but no pressure -->
![A GIF or MEME to give some spice of the internet](url)

## *What* is wrong?
<!-- Ex. training network takes really long -->

## *Where* does it happen?
<!-- Ex. In the a NeuralNetwork when trying to run a net in node.js on my mac -->

## *How* do we replicate the issue?
<!-- Please be specific as possible. Use dashes (-) or numbers (1.) to create a list of steps -->

## *How* important is this (1-5)?
<!-- On a scale from 1-5 where 5 is the most important how would you rate it? -->

## Expected behavior (i.e. solution)
<!-- What do you think should have happened? -->


## Other Comments
39 changes: 39 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,39 @@
<!--- Provide a general summary of your changes in the Title above -->

<!-- If you don't mind add a fun gif or meme, but no pressure -->
![A GIF or MEME to give some spice of the internet](url)

## Description
<!--- Describe your changes in detail -->

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
[issue](https://github.com/BrainJS/brain.js/issues/###)

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, tests ran to see how -->
<!--- your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

## Author's Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code focuses on the main motivation and avoids scope creep.
- [ ] My code passes current tests and adds new tests where possible.
- [ ] My code is [SOLID](https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)) and [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself).
- [ ] I have updated the documentation as needed.

## Reviewer's Checklist:
- [ ] I kept my comments to the author positive, specific, and productive.
- [ ] I tested the code and didn't find any new problems.
- [ ] I think the motivation is good for the project.
- [ ] I think the code works to satisfies the motivation.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -246,3 +246,9 @@ Likely example see: [simple letter detection](./examples/which-letter-simple.js)
Different neural nets do different things well. For example:
* A Feedforward Neural Network can classify simple things very well, but it has no memory of previous actions and has infinite variation of results.
* A Recurrent Neural Network _remembers_, and has a finite set of results.

# Get Involved!
### Issues
If you have an issue, either a bug or a feature you think would benefit your project let us know and we will do our best.

Create issues [here](https://github.com/BrainJS/brain.js/issues) and follow the template.
4 changes: 2 additions & 2 deletions bower.json
@@ -1,6 +1,6 @@
{
"name": "brain.js",
"homepage": "https://github.com/harthur-org/brain.js",
"homepage": "https://github.com/brainjs/brain.js",
"authors": [
"Heather Arthur <fayearthur@gmail.com>"
],
Expand Down Expand Up @@ -31,5 +31,5 @@
"node_modules",
"test"
],
"version": "1.0.0-rc.5"
"version": "1.0.3"
}
65 changes: 50 additions & 15 deletions browser.js
Expand Up @@ -6,7 +6,7 @@
* license: MIT (http://opensource.org/licenses/MIT)
* author: Heather Arthur <fayearthur@gmail.com>
* homepage: https://github.com/brainjs/brain.js#readme
* version: 1.0.2
* version: 1.0.3
*
* acorn:
* license: MIT (http://opensource.org/licenses/MIT)
Expand Down Expand Up @@ -1581,12 +1581,12 @@ var NeuralNetwork = function () {
} else if (i === this.outputLayer && (!layer[0] || json.outputLookup)) {
this.outputLookup = _lookup2.default.lookupFromHash(layer);
}
if (layer > 0) {
if (i > 0) {
var nodes = Object.keys(layer);
this.sizes[i] = nodes.length;
for (var j in nodes) {
var node = nodes[j];
this.biases[i] = layer[node].bias;
this.biases[i][j] = layer[node].bias;
this.weights[i][j] = (0, _toArray2.default)(layer[node].weights);
}
}
Expand Down Expand Up @@ -2479,6 +2479,44 @@ var Matrix = function () {
weights: this.weights.slice(0)
};
}
}, {
key: 'weightsToArray',
value: function weightsToArray() {
var deltas = [];
var row = 0;
var column = 0;
for (var i = 0; i < this.weights.length; i++) {
if (column === 0) {
deltas.push([]);
}
deltas[row].push(this.weights[i]);
column++;
if (column >= this.columns) {
column = 0;
row++;
}
}
return deltas;
}
}, {
key: 'deltasToArray',
value: function deltasToArray() {
var deltas = [];
var row = 0;
var column = 0;
for (var i = 0; i < this.deltas.length; i++) {
if (column === 0) {
deltas.push([]);
}
deltas[row].push(this.deltas[i]);
column++;
if (column >= this.columns) {
column = 0;
row++;
}
}
return deltas;
}
}], [{
key: 'fromJSON',
value: function fromJSON(json) {
Expand Down Expand Up @@ -4356,7 +4394,7 @@ var _randomWeight2 = _interopRequireDefault(_randomWeight);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function randos(size) {
var array = new Array(size);
var array = new Float32Array(size);
for (var i = 0; i < size; i++) {
array[i] = (0, _randomWeight2.default)();
}
Expand Down Expand Up @@ -4397,30 +4435,27 @@ exports.default = toArray;
* @returns {*}
*/
function toArray(values) {
values = values || [];
if (Array.isArray(values)) {
return values;
} else {
return Object.keys(values).map(function (key) {
return values[key];
});
var keys = Object.keys(values);
var result = new Float32Array(keys.length);
for (var i in keys) {
result[i] = values[keys[i]];
}
return result;
}
}

},{}],43:[function(require,module,exports){
'use strict';
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = zeros;
function zeros(size) {
if (typeof Float32Array !== 'undefined') return new Float32Array(size);
var array = new Array(size);
for (var i = 0; i < size; i++) {
array[i] = 0;
}
return array;
return new Float32Array(size);
}

},{}],44:[function(require,module,exports){
Expand Down
20 changes: 10 additions & 10 deletions browser.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/neural-network.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/neural-network.js.map

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions dist/recurrent/matrix/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/recurrent/matrix/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 166c0f5

Please sign in to comment.