mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-23 23:26:25 +01:00
Add generate_binaries.sh
This commit is contained in:
parent
d7d87345ef
commit
835a08cf46
23
src/scripts/generate_binaries.sh
Executable file
23
src/scripts/generate_binaries.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
# Use with
|
||||
# ```bash
|
||||
# $ python -i src/scripts/benchmark_binary.py
|
||||
# >>> compare_binaries(["binaries/"+i for i in os.listdir("binaries")], tries=10, dataset='train')
|
||||
# ```
|
||||
BIN_OUT=binaries
|
||||
FILE_TO_MODIFY="src/cnn/include/train.h"
|
||||
VARIABLE_TO_MODIFY="LEARNING_RATE"
|
||||
|
||||
mkdir -p "$BIN_OUT"
|
||||
rm -rf "$BIN_OUT"/*
|
||||
|
||||
values="0 5 25 50" # Example values
|
||||
|
||||
for val in $values; do
|
||||
# For a variable
|
||||
# sed -i 's/'"$VARIABLE_TO_MODIFY"'=.*/'"$VARIABLE_TO_MODIFY'='$val"';/g' "$FILE_TO_MODIFY"
|
||||
# For a define
|
||||
sed -i 's/#define '"$VARIABLE_TO_MODIFY"' .*$/#define '"$VARIABLE_TO_MODIFY"' '"$val"'/g' "$FILE_TO_MODIFY"
|
||||
make all
|
||||
cp build/cnn-main "$BIN_OUT"/"$VARIABLE_TO_MODIFY=$val"
|
||||
done
|
Loading…
Reference in New Issue
Block a user