-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added BENCHMARK_SHELL to found benchmarks
- Loading branch information
1 parent
f9d81e7
commit d3e932a
Showing
13 changed files
with
119 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,10 @@ | ||
#!/bin/bash | ||
|
||
PYTHON="python3" | ||
OUT=${OUT:-$PWD/result} | ||
TMP=${TMP:-$PWD/tmp} | ||
#export tmp to env | ||
export TMP | ||
SCRIPTS=${SCRIPTS:-$PWD/scripts} | ||
REPO_TOP=$(git rev-parse --show-toplevel) | ||
eval_dir="${REPO_TOP}/sklearn" | ||
scripts_dir="${eval_dir}/scripts" | ||
|
||
# Ideally, we'll move on to piping rather than writing to a file | ||
MODEL=$TMP/model.obj | ||
X=$TMP/X_train.obj | ||
y=$TMP/y_train.obj | ||
CLASSES=$TMP/classes.obj | ||
DUAL=false # should be converted to bool inside script | ||
MAX_SQ_SUM=$TMP/max_squared_sum.obj | ||
WARM_COEF=$TMP/warm_start_coef.obj | ||
C_=$TMP/C_.obj | ||
BENCHMARK_SHELL=${BENCHMARK_SHELL:-bash} | ||
cd "$eval_dir" # scripts/run.sh references PWD | ||
$BENCHMARK_SHELL "$scripts_dir/run.sh" $@ | ||
|
||
echo $PYTHON >&2 | ||
echo "DIR: $DIR" >&2 | ||
echo "SCRIPTS: $SCRIPTS" >&2 | ||
echo "MODEL: $MODEL" >&2 | ||
echo "X: $X" >&2 | ||
echo "y: $y" >&2 | ||
echo "CLASSES: $CLASSES" >&2 | ||
echo "DUAL: $DUAL" >&2 | ||
echo "MAX_SQ_SUM: $MAX_SQ_SUM" >&2 | ||
echo "WARM_COEF: $WARM_COEF" >&2 | ||
echo "C_: $C_" >&2 | ||
|
||
# TODO: Try this out on a larger dataset | ||
# TODO: Benchmark each phase | ||
|
||
# Generating model & samples | ||
$PYTHON $SCRIPTS/gen_model.py 100 | ||
$PYTHON $SCRIPTS/gen_samples.py | ||
|
||
# Validity checking functions | ||
# These functions just check to make sure that the input is valid. | ||
# If not they will raise an error. Otherwise, they do not mutate the data. | ||
$PYTHON $SCRIPTS/check_solver.py $MODEL | ||
penalty=$($PYTHON $SCRIPTS/penalty.py $MODEL) | ||
$PYTHON $SCRIPTS/val_data.py $MODEL $X $y | ||
$PYTHON $SCRIPTS/classes.py $MODEL $y # This should return a classes with just the unique classes in y | ||
echo "$PYTHON $SCRIPTS/check_multiclass.py $MODEL" >&2 | ||
multiclass=$($PYTHON $SCRIPTS/check_multiclass.py $MODEL) | ||
echo "------" >&2 | ||
# TODO: Benchmark each step of the pipeline | ||
# Make a modified pipeline where each step writes its output to a file | ||
|
||
# Calculations functions | ||
$PYTHON $SCRIPTS/rownorm.py $X | ||
n_classes=$($PYTHON $SCRIPTS/reshape_classes.py $MODEL $CLASSES) | ||
$PYTHON $SCRIPTS/warm_start.py $MODEL $multiclass $n_classes # pipes coefficients | ||
|
||
# Covtype dataset has 7 classes | ||
echo "WARM_COEF: $WARM_COEF" >&2 | ||
echo "MAX_SQ_SUM: $MAX_SQ_SUM" >&2 | ||
|
||
echo "multiclass: $multiclass" >&2 | ||
echo "penalty: $penalty" >&2 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 1 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 2 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 3 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 4 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 5 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 6 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 7 | ||
|
||
$PYTHON $SCRIPTS/zip_coef.py $MODEL | ||
$PYTHON $SCRIPTS/adjust_coef.py $MODEL $X $multiclass $n_classes $RESULT/trained_model.obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
|
||
PYTHON="python3" | ||
OUT=${OUT:-$PWD/result} | ||
TMP=${TMP:-$PWD/tmp} | ||
#export tmp to env | ||
export TMP | ||
SCRIPTS=${SCRIPTS:-$PWD/scripts} | ||
|
||
# Ideally, we'll move on to piping rather than writing to a file | ||
MODEL=$TMP/model.obj | ||
X=$TMP/X_train.obj | ||
y=$TMP/y_train.obj | ||
CLASSES=$TMP/classes.obj | ||
DUAL=false # should be converted to bool inside script | ||
MAX_SQ_SUM=$TMP/max_squared_sum.obj | ||
WARM_COEF=$TMP/warm_start_coef.obj | ||
C_=$TMP/C_.obj | ||
|
||
echo $PYTHON >&2 | ||
echo "DIR: $DIR" >&2 | ||
echo "SCRIPTS: $SCRIPTS" >&2 | ||
echo "MODEL: $MODEL" >&2 | ||
echo "X: $X" >&2 | ||
echo "y: $y" >&2 | ||
echo "CLASSES: $CLASSES" >&2 | ||
echo "DUAL: $DUAL" >&2 | ||
echo "MAX_SQ_SUM: $MAX_SQ_SUM" >&2 | ||
echo "WARM_COEF: $WARM_COEF" >&2 | ||
echo "C_: $C_" >&2 | ||
|
||
# TODO: Try this out on a larger dataset | ||
# TODO: Benchmark each phase | ||
|
||
# Generating model & samples | ||
$PYTHON $SCRIPTS/gen_model.py 100 | ||
$PYTHON $SCRIPTS/gen_samples.py | ||
|
||
# Validity checking functions | ||
# These functions just check to make sure that the input is valid. | ||
# If not they will raise an error. Otherwise, they do not mutate the data. | ||
$PYTHON $SCRIPTS/check_solver.py $MODEL | ||
penalty=$($PYTHON $SCRIPTS/penalty.py $MODEL) | ||
$PYTHON $SCRIPTS/val_data.py $MODEL $X $y | ||
$PYTHON $SCRIPTS/classes.py $MODEL $y # This should return a classes with just the unique classes in y | ||
echo "$PYTHON $SCRIPTS/check_multiclass.py $MODEL" >&2 | ||
multiclass=$($PYTHON $SCRIPTS/check_multiclass.py $MODEL) | ||
echo "------" >&2 | ||
# TODO: Benchmark each step of the pipeline | ||
# Make a modified pipeline where each step writes its output to a file | ||
|
||
# Calculations functions | ||
$PYTHON $SCRIPTS/rownorm.py $X | ||
n_classes=$($PYTHON $SCRIPTS/reshape_classes.py $MODEL $CLASSES) | ||
$PYTHON $SCRIPTS/warm_start.py $MODEL $multiclass $n_classes # pipes coefficients | ||
|
||
# Covtype dataset has 7 classes | ||
echo "WARM_COEF: $WARM_COEF" >&2 | ||
echo "MAX_SQ_SUM: $MAX_SQ_SUM" >&2 | ||
|
||
echo "multiclass: $multiclass" >&2 | ||
echo "penalty: $penalty" >&2 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 1 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 2 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 3 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 4 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 5 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 6 | ||
$PYTHON $SCRIPTS/parallel.py $MODEL $X $y $C_ $WARM_COEF $MAX_SQ_SUM $multiclass $penalty 7 | ||
|
||
$PYTHON $SCRIPTS/zip_coef.py $MODEL | ||
$PYTHON $SCRIPTS/adjust_coef.py $MODEL $X $multiclass $n_classes $RESULT/trained_model.obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
cat "logs-popcount-org.txt" | sort | uniq > "out.txt" | ||
#!/bin/bash | ||
|
||
REPO_TOP=$(git rev-parse --show-toplevel) | ||
eval_dir="${REPO_TOP}/uniq-ips" | ||
scripts_dir="${eval_dir}/scripts" | ||
|
||
BENCHMARK_SHELL=${BENCHMARK_SHELL:-bash} | ||
cd "$eval_dir" # scripts/run.sh puts files in its current directory | ||
$BENCHMARK_SHELL "$scripts_dir/run.sh" $@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cat "logs-popcount-org.txt" | sort | uniq > "out.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters