You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The readme is the basis of this. I have been needing to push this up for a while but wanted to get it working. This works as far as I have gotten on it.
It...
1) creates a network in main.js then get's the json from it.
2) generates a set of training data.
3) passes the network json and a partition of the training data to each process
4) recreates then trains the network on each process
5) creates a json of the each network and passes them back to the main process
6) The next step to do...
The next steps
1) combine the networks into 1 network (I think simple addition will work for this when parsing the network but haven't tested it yet
2) test the new combination network to see if it is actually acurate
3) stream line it into something usable by someone else.
Getting brain to train in parallel (on many machines or on many threads).
3
+
4
+
# Getting Started
5
+
This uses [klyng](https://www.npmjs.com/package/klyng) which is also built on [fibers](https://www.npmjs.com/package/fibers).
6
+
7
+
Get `klyng` installed globally:
8
+
```
9
+
yarn global add klyng
10
+
```
11
+
12
+
`klyng` by default runs a _beacon_ on port `:2222`. You can change the port and add a password in the config file. If you ran the above command it is found here by default `~/.config/yarn/global/node_modules/klyng/config.json`.
13
+
14
+
There is also the `machine.json` which describes how communication on the cluster will perform.
15
+
16
+
17
+
# Scripts
18
+
19
+
#### down
20
+
```
21
+
yarn down
22
+
```
23
+
Shuts down the klyng beacon. You shouldn't have to do this unless you are running a bunch of klyng commands at once and it things start breaking and it isn't handled nicely
24
+
25
+
#### up
26
+
```
27
+
yarn up
28
+
```
29
+
Starts the klyng beacon. If running a klyng script and the beacon isn't up you shouldn't need to do that. This might need to be done manually when running on secondary machines.
30
+
31
+
#### start
32
+
```
33
+
yarn start
34
+
```
35
+
Start `cluster.js` Currently configured in the `packages.json` to start 6 local processses. Currently hard coded to train a network in solving the [likely](https://github.com/BrainJS/brain.js/blob/develop/test/base/likely.js) problem. As this gets flushed out there will be better documentation and integration with `brain.js` directly.
36
+
37
+
#### cluster
38
+
```
39
+
yarn cluster
40
+
```
41
+
will start `cluster.js` but will also apply the `machines.json` This is just in reference to how to run on a cluster, but hasn't been flushed out yet (also the machines.json doesn't mean anything at this point)
42
+
43
+
#### example
44
+
```
45
+
yarn example
46
+
```
47
+
starts a trivial example, used for concept testing on klyng. This will get removed eventually but is still useful in testing out specific functionality
48
+
49
+
#### test-sizes
50
+
```
51
+
yarn test-sizes
52
+
```
53
+
Like example this is used for testing specifically how large of a data set we can send back and forth from klyng instances. The documentation on klyng isn't stellar so this was a semi-stress test. This will also be removed as `brain-cluster` matures
"description": "Brain.js in a distributed system. Train in async on your local machine, in async accross many machines, or on something like a Beowulf cluster.",
5
+
"main": "cluster.js",
6
+
"scripts": {
7
+
"down": "klyng --beacon-down",
8
+
"up": "klyng --beacon-up",
9
+
"start": "klyng -n 6 cluster.js",
10
+
"example": "klyng -n 6 example.js",
11
+
"test-sizes": "klyng -n 2 test-size.js && yarn down && klyng -n 4 test-size.js && yarn down && klyng -n 8 test-size.js && yarn down && klyng -n 16 test-size.js && yarn down && klyng -n 32 test-size.js && yarn down && klyng -n 64 test-size.js && yarn down && klyng -n 128 test-size.js",
0 commit comments