-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.sh
executable file
·43 lines (43 loc) · 908 Bytes
/
demo.sh
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/bash
#
# demo.sh
#
# Rex Sutton 2016.
#
# test for data
if [ ! -d usps_resampled ]
then
echo "*** The demo data has not been downloaded. ***"
exit
fi
# train the gp
if [ -e classifier ]
then
echo "*** The classifier has already been trained. ***"
echo "*** Remove the classifier to repeat training (y)? ***"
read confirm
if [ $confirm = 'y' ] ; then
rm -rf classifier
fi
fi
# train the classifier
if [ ! -e classifier ]
then
echo "*** Begin training (should take less than two minutes). ***"
python Demo.py -ctrain
if [[ $? != 0 ]]
then
echo "*** Failed to run Demo.py, use python 2.7 ***"
exit
fi
echo "*** Training complete. ***"
fi
# test the gp
echo "*** Begin testing. ***"
python Demo.py -ctest
if [[ $? != 0 ]]
then
echo "*** Failed to run Demo.py, use python 2.7 ***"
exit
fi
echo "*** Testing complete. ***"