Skip to content

Commit

Permalink
Update socks model
Browse files Browse the repository at this point in the history
  • Loading branch information
wizawu committed Nov 6, 2023
1 parent f165e32 commit e9ebb30
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion bin/wxwork
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

if [ "$1" = off ]; then
if [ "$1" = pause ]; then
VBoxManage controlvm wxwork savestate
elif [ "$1" = reset ]; then
VBoxManage controlvm wxwork reset
Expand Down
82 changes: 41 additions & 41 deletions roles/socks/files/model.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,64 +13,64 @@
{
"weights": [
[
-1.8150660991668701,
-1.6036111116409302,
-0.9105259776115417,
-4.750807762145996,
0.7041926980018616,
5.268732070922852,
-1.5064481496810913,
1.9523690938949585
9.254154205322266,
3.226205825805664,
-0.10864460468292236,
-0.7786291241645813,
1.0749684572219849,
0.7949228882789612,
2.1225788593292236,
1.516159176826477
],
[
-4.201215744018555,
1.0199609994888306,
-0.4080450236797333,
-3.193182945251465,
-0.37088778614997864,
2.3759918212890625,
-0.923011064529419,
1.7830862998962402
-2.2315673828125,
-0.4349869191646576,
-0.9913473129272461,
5.486702919006348,
-2.222933292388916,
6.3236212730407715,
-2.160618305206299,
4.335207462310791
],
[
-4.873551845550537,
1.2540990114212036,
-0.5334508419036865,
-3.9021096229553223,
-0.6086262464523315,
2.8386478424072266,
-1.1008332967758179,
2.1385128498077393
3.649057626724243,
0.7811000347137451,
0.18399403989315033,
0.8720407485961914,
0.4192882180213928,
-1.1314951181411743,
1.2625271081924438,
-1.783936619758606
],
[
-0.5293073654174805,
-2.8558497428894043,
0.24920958280563354,
2.716989278793335,
-0.10449783504009247,
-0.3360624313354492,
1.5425251722335815,
-1.158874273300171
-3.9054038524627686,
-3.3554959297180176,
1.6739517450332642,
2.4722161293029785,
-0.12326213717460632,
-1.036186695098877,
2.8382656574249268,
-2.441895008087158
]
],
"biases": [
3.312721014022827,
-0.69923996925354,
-0.7946462035179138,
1.5973947048187256
-3.4684717655181885,
0.47295334935188293,
-2.953230619430542,
3.0617027282714844
]
},
{
"weights": [
[
0.9120532870292664,
0.16347146034240723,
1.988828420639038,
-1.8826320171356201
3.192861557006836,
1.744760274887085,
-0.8989359736442566,
-3.640486240386963
]
],
"biases": [
-0.7506352663040161
-2.5797712802886963
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion roles/socks/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"scripts": {
"build": "tsc main.ts",
"start": "npm run build && node main.js",
"write": "npm run build && node -e 'require(\"./train.js\").writeData(21); process.exit()'",
"write": "npm run build && node -e 'require(\"./train.js\").writeData(22); process.exit()'",
"train": "npm run build && rm -f model.json && node -e 'require(\"./train.js\").train(); process.exit()'"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion roles/socks/files/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ setInterval(() => {
online = child.status === 0
if (!online) {
log.warn("I am offline")
db.exec(`delete from history where time < ${Date.now() - 90 * 86400 * 1000}`)
db.exec(`delete from history where time < ${Date.now() - 30 * 86400 * 1000}`)
db.exec("VACUUM")
}
}, 5000)
Expand Down
2 changes: 1 addition & 1 deletion roles/socks/files/train.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ const log = LoggerFactory.getLogger("\t\b\b\b\b\b\b\b")
log.level = "debug"

const data = [
...JSON.parse(fs.readFileSync("./data.18.json", "utf-8")),
...JSON.parse(fs.readFileSync("./data.19.json", "utf-8")),
...JSON.parse(fs.readFileSync("./data.20.json", "utf-8")),
...JSON.parse(fs.readFileSync("./data.21.json", "utf-8")),
...JSON.parse(fs.readFileSync("./data.22.json", "utf-8")),
]

const net = new brain.NeuralNetwork()
Expand Down

0 comments on commit e9ebb30

Please sign in to comment.