Skip to content

Commit

Permalink
Format jsdoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
umcconnell committed Jul 2, 2019
1 parent dcb323c commit 793e8d5
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ export class Layer {

/**
* Adds Biases object to layer
* @param {Biases} biases biases object from Biases constructor; belongs to ouput layer
* @param {Biases} biases biases object from Biases constructor; belongs to
* ouput layer
* @example
* let inputLayer = new Layer(5);
* let outputLayer = new Layer(2);
Expand All @@ -130,7 +131,8 @@ export class Layer {

/**
* Adds Weights object to layer
* @param {Weights} weights weights object from Weights constructor; belongs to input layer
* @param {Weights} weights weights object from Weights constructor; belongs
* to input layer
* @example
* let inputLayer = new Layer(5);
* let outputLayer = new Layer(2);
Expand All @@ -151,7 +153,8 @@ export class Layer {

/**
* Applys given function to all neurons of the layer
* @param {Function} func mapping function called with neuron value and index
* @param {Function} func mapping function called with neuron value and
* index
* @example
* outputLayer.apply(sigmoid);
* @returns layer
Expand Down Expand Up @@ -180,7 +183,8 @@ export class Layer {

/**
* Populates neurons with data
* @param {Array} data array of data to populate layer / neurons with; must be same length as layer
* @param {Array} data array of data to populate layer / neurons with; must
* be same length as layer
* @returns layer
*/
populate(data) {
Expand All @@ -193,7 +197,8 @@ export class Layer {
}

/**
* Runs connection between two layers by applying weights to input layer's neurons and biases to resulting output layer's neurons
* Runs connection between two layers by applying weights to input layer's
* neurons and biases to resulting output layer's neurons
* @example
* let inputLayer = new Layer(5);
* let outputLayer = new Layer(2);
Expand Down Expand Up @@ -234,14 +239,16 @@ export class Layer {
export class Network extends Array {
/**
* Creates a neural network with given layers
* @param {Array} layers array of Layer objects or numbers representing layer length
* @param {Array} layers array of Layer objects or numbers representing
* layer length
*/
constructor(layers) {
super(...layers.map(el => (el instanceof Layer ? el : new Layer(el))));
}

/**
* Adds randomly filled bias matrix with correct dimensions to every layer by calling Biases constructor
* Adds randomly filled bias matrix with correct dimensions to every layer
* by calling Biases constructor
* @returns {Network}
*/
addBiases() {
Expand All @@ -254,7 +261,8 @@ export class Network extends Array {
}

/**
* Adds randomly filled weight matrix with correct dimensions to every layer by calling Weights constructor
* Adds randomly filled weight matrix with correct dimensions to every layer
* by calling Weights constructor
* @returns {Network}
*/
addWeights() {
Expand All @@ -270,7 +278,8 @@ export class Network extends Array {

/**
* Applies a function to every layer by calling layer.apply() on every layer
* @param {Function} func mapping function called on every layer with layer.apply()
* @param {Function} func mapping function called on every layer with
* layer.apply()
* @returns {Network}
*/
apply(func) {
Expand Down

0 comments on commit 793e8d5

Please sign in to comment.