-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminibatch
executable file
·84 lines (78 loc) · 1.85 KB
/
minibatch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env coffee
minibatch = require './minibatch.coffee'
defaults = minibatch.defaults
yargs = require 'yargs'
.options
p:
alias: 'phase'
desc: 'Game phase (0-9)'
type: 'number'
requiresArg: true
demandOption: true
o:
alias: 'outfile'
desc: 'Output file'
type: 'string'
requiresArg: true
b:
alias: 'book'
desc: 'Database file'
default: defaults.book
requiresArg: true
B:
alias: 'batch_size'
desc: 'Batch size (default auto)'
requiresArg: true
e:
alias: 'epochs'
desc: 'Number of epochs'
default: defaults.epochs
requiresArg: true
r:
alias: 'rate'
desc: 'Learning rate (default auto)'
requiresArg: true
l:
alias: 'logistic'
desc: 'Logistic regression'
type: 'boolean'
l2:
desc: 'L2 regularization parameter'
default: defaults.l2
requiresArg: true
cv:
desc: 'K-fold cross validation'
type: 'number'
requiresArg: true
search:
desc: 'Search optimal L2 parameter'
type: 'boolean'
search_precision:
desc: 'Precision of L2 parameter search (>1)'
type: 'number'
default: defaults.search_precision
requiresArg: true
search_min:
desc: 'Minimum value to search L2 parameter'
type: 'number'
default: defaults.search_min
requiresArg: true
search_max:
desc: 'Maximum value to search L2 parameter'
type: 'number'
default: defaults.search_max
requiresArg: true
offset:
desc: 'Use offset'
type: 'boolean'
default: defaults.offset
h:
alias: 'help'
.strict()
.version false
argv = yargs.argv
if not argv.cv and not argv.search and not argv.outfile
yargs.showHelp()
console.error '--outfile is required'
process.exit 1
minibatch argv