-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
do-lrq-hogwild
executable file
·43 lines (34 loc) · 1.01 KB
/
do-lrq-hogwild
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
#! /bin/zsh
nukeem() { \
trap - INT QUIT TERM
pkill -9 -f 'vw.*--port 26542'
}
if which netcat 2>/dev/null; then
netcat=netcat
elif which nc 2>/dev/null; then
netcat=nc
else
echo "Install netcat or nc" >&2
exit 1
fi
rm -f "$1"
{ ../../vowpalwabbit/vw --loss_function quantile -l 0.45 -b 24 --holdout_off --lrq um14 --lrqdropout --adaptive --invariant -f "$1" --daemon --num_children 4 --port 26542 2>&1 | perl -lane 'print $_ unless $c{$F[2]}++; ' } &
trap 'nukeem; exit 1' INT QUIT TERM
while ! $netcat -z localhost 26542
do
sleep 1
done
for pass in $(seq 1 100)
do
cat ml-1m.ratings.train.vw
done | \
./map \
>($netcat localhost 26542 > /dev/null) \
>($netcat localhost 26542 > /dev/null) \
>($netcat localhost 26542 > /dev/null) \
>($netcat localhost 26542 > /dev/null)
pkill -f 'vw.*--port 26542'
while test ! -s "$1"
do
sleep 1
done