Skip to content

Commit 1fd01f2

Browse files
author
Juan Cazala
committed
formating
1 parent ff8a2ec commit 1fd01f2

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

src/Network.js

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class Network {
2929
}
3030
}
3131

32-
// back-propagate the error thru the network
32+
// back-propagate the error thru the network
3333
propagate(rate, target) {
3434
if (this.optimized === false) {
3535
this.layers.output.propagate(rate, target);
@@ -43,7 +43,7 @@ export default class Network {
4343
}
4444
}
4545

46-
// project a connection to another unit (either a network or a layer)
46+
// project a connection to another unit (either a network or a layer)
4747
project(unit, type, weights) {
4848
if (this.optimized)
4949
this.optimized.reset();
@@ -57,14 +57,14 @@ export default class Network {
5757
throw new Error('Invalid argument, you can only project connections to LAYERS and NETWORKS!');
5858
}
5959

60-
// let this network gate a connection
60+
// let this network gate a connection
6161
gate(connection, type) {
6262
if (this.optimized)
6363
this.optimized.reset();
6464
this.layers.output.gate(connection, type);
6565
}
6666

67-
// clear all elegibility traces and extended elegibility traces (the network forgets its context, but not what was trained)
67+
// clear all elegibility traces and extended elegibility traces (the network forgets its context, but not what was trained)
6868
clear() {
6969
this.restore();
7070

@@ -81,7 +81,7 @@ export default class Network {
8181
this.optimized.reset();
8282
}
8383

84-
// reset all weights and clear all traces (ends up like a new network)
84+
// reset all weights and clear all traces (ends up like a new network)
8585
reset() {
8686
this.restore();
8787

@@ -98,7 +98,7 @@ export default class Network {
9898
this.optimized.reset();
9999
}
100100

101-
// hardcodes the behaviour of the whole network into a single optimized function
101+
// hardcodes the behaviour of the whole network into a single optimized function
102102
optimize() {
103103
var that = this;
104104
var optimized = {};
@@ -178,7 +178,7 @@ export default class Network {
178178
this.propagate = network.propagate;
179179
}
180180

181-
// restores all the values from the optimized network the their respective objects in order to manipulate the network
181+
// restores all the values from the optimized network the their respective objects in order to manipulate the network
182182
restore() {
183183
if (!this.optimized)
184184
return;
@@ -235,7 +235,7 @@ export default class Network {
235235
}
236236
}
237237

238-
// returns all the neurons in the network
238+
// returns all the neurons in the network
239239
neurons() {
240240
var neurons = [];
241241

@@ -268,17 +268,17 @@ export default class Network {
268268
return neurons;
269269
}
270270

271-
// returns number of inputs of the network
271+
// returns number of inputs of the network
272272
inputs() {
273273
return this.layers.input.size;
274274
}
275275

276-
// returns number of outputs of hte network
276+
// returns number of outputs of hte network
277277
outputs() {
278278
return this.layers.output.size;
279279
}
280280

281-
// sets the layers of the network
281+
// sets the layers of the network
282282
set(layers) {
283283
this.layers = {
284284
input: layers.input || null,
@@ -296,7 +296,7 @@ export default class Network {
296296
this.optimized = bool ? null : false;
297297
}
298298

299-
// returns a json that represents all the neurons and connections of the network
299+
// returns a json that represents all the neurons and connections of the network
300300
toJSON(ignoreTraces) {
301301
this.restore();
302302

@@ -364,7 +364,7 @@ export default class Network {
364364
}
365365
}
366366

367-
// export the topology into dot language which can be visualized as graphs using dot
367+
// export the topology into dot language which can be visualized as graphs using dot
368368
/* example: ... console.log(net.toDotLang());
369369
$ node example.js > example.dot
370370
$ dot example.dot -Tpng > out.png
@@ -416,7 +416,7 @@ export default class Network {
416416
}
417417
}
418418

419-
// returns a function that works as the activation of the network and can be used without depending on the library
419+
// returns a function that works as the activation of the network and can be used without depending on the library
420420
standalone() {
421421
if (!this.optimized)
422422
this.optimize();
@@ -468,11 +468,10 @@ export default class Network {
468468
}
469469

470470

471-
// Return a HTML5 WebWorker specialized on training the network stored in `memory`.
472-
// Train based on the given dataSet and options.
473-
// The worker returns the updated `memory` when done.
471+
// Return a HTML5 WebWorker specialized on training the network stored in `memory`.
472+
// Train based on the given dataSet and options.
473+
// The worker returns the updated `memory` when done.
474474
worker(memory, set, options) {
475-
476475
// Copy the options and set defaults (options might be different for each worker)
477476
var workerOptions = {};
478477
if (options) workerOptions = options;
@@ -531,7 +530,7 @@ export default class Network {
531530
return new Worker(blobURL);
532531
}
533532

534-
// returns a copy of the network
533+
// returns a copy of the network
535534
clone() {
536535
return Network.fromJSON(this.toJSON());
537536
}
@@ -545,7 +544,7 @@ export default class Network {
545544
*/
546545
static getWorkerSharedFunctions() {
547546
// If we already computed the source code for the shared functions
548-
if(typeof Network._SHARED_WORKER_FUNCTIONS !== 'undefined')
547+
if (typeof Network._SHARED_WORKER_FUNCTIONS !== 'undefined')
549548
return Network._SHARED_WORKER_FUNCTIONS;
550549

551550
// Otherwise compute and return the source code

0 commit comments

Comments
 (0)