-
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.
Merge pull request #10 from ehirdoy/addinference
Execute "inference"(test) with a trained model
- Loading branch information
Showing
9 changed files
with
256 additions
and
122 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# ToDo | ||
|
||
## Bugfix | ||
- Don't kill when it's done. | ||
- Lwt'ization of loading data from files. Potentially fail. | ||
|
||
## New features | ||
- report: add memory usage instrument by Gc module | ||
- memory/execution time profiling tools: just interested to briefly discuss what kind of tools being used for profiling. Current I'm using valgrind but not very handy. | ||
- add support of dynamic population of workers | ||
- Depends on barrier method used. E.g: | ||
- the management of workers’ information in the book. | ||
- if it’s the BSP, then removing a worker will stop all the others; | ||
- if it’s ASP, then dynamically removing one or adding it back should be no problem. | ||
- evaluation setup: use multiple rpi devices, or one large server, to scale up. | ||
- github: add Travis-CI for D-MNIST with Unix && MirageOS, make sure to not break with further commits | ||
- lwae: fix transparent parallelism behind LwAE from consistent training interface as the original AE does | ||
- lwae: add other Barrier support, Jianxin? | ||
- for the barrier support, I've added some initial implementation here: https://github.com/jzstark/light_actor/blob/lda/src/core/actor_barrier_ssp.ml | ||
|
||
## Unsorted | ||
- besides mnist training, find several IoT-based use cases where multiple instances interact with each other | ||
- difficulties in wrapping up an Owl script into Unikernel; possible automation of this process and deployment to edge devices | ||
|
||
## Pending | ||
- owl: build Owl without Unix dependency for MirageOS https://github.com/owlbarn/owl/pull/372 No good idea for now | ||
- ex: gettimeofday -> ptime??? | ||
|
||
## Done | ||
- ~~mnist: add inference/test after training~~ | ||
- ~~mnist: add Random'ization of get_next, currently it's incremented sequentially, but should be random'ized.~~ | ||
- ~~report: add support arbitral number of clients automatically 128~~ |
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,27 +1,33 @@ | ||
#!/bin/bash | ||
|
||
img_file="train-images-idx3-ubyte" | ||
lvl_file="train-labels-idx1-ubyte" | ||
|
||
[ -f "$img_file" ] || curl -o - http://yann.lecun.com/exdb/mnist/"$img_file".gz > "$img_file" | ||
[ -f "$lvl_file" ] || curl -o - http://yann.lecun.com/exdb/mnist/"$lvl_file".gz > "$lvl_file" | ||
|
||
batch=1000 | ||
max=$((60000 / batch - 1)) | ||
# bytes file name | ||
#---------------------------------- | ||
# 47040016 train-images-idx3-ubyte | ||
# 60008 train-labels-idx1-ubyte | ||
# 7840016 t10k-images-idx3-ubyte | ||
# 10008 t10k-labels-idx1-ubyte | ||
|
||
mkdir -p t | ||
|
||
img_header=16 | ||
time for x in $(seq 0 $max); do | ||
num=$(printf "%03d" $x) | ||
unit=$((28 * 28 * batch)) | ||
dd if=$img_file of=t/$img_file-$num.bmp bs=1 count=$unit skip=$((img_header + x * unit)) | ||
for t in "train" "t10k"; do | ||
for x in "images" "labels"; do | ||
[ "$x" = "images" ] && n=3 || n=1 | ||
f="$t-$x-idx$n-ubyte" | ||
[ -f "$f" ] || \ | ||
curl -o - http://yann.lecun.com/exdb/mnist/"$f".gz | gunzip > "$f" | ||
done | ||
done | ||
|
||
lvl_header=8 | ||
for x in $(seq 0 $max); do | ||
num=$(printf "%03d" $x) | ||
unit=$((1 * batch)) | ||
dd if=$lvl_file of=t/$lvl_file-$num.lvl bs=1 count=$unit skip=$((lvl_header + x * unit)) | ||
batch=1000 | ||
ls *-ubyte | while read f; do | ||
echo $f | grep -q "images" && header=16 || header=8 | ||
echo $f | grep -q "images" && ext="bmp" || ext="lvl" | ||
echo $f | grep -q "images" && unit=$((28 * 28 * batch)) || unit=$((1 * batch)) | ||
echo $f | grep -q "train" && entries=60000 || entries=10000 | ||
max=$((entries / batch - 1)) | ||
for i in $(seq 0 $max); do | ||
n=$(printf "%03d" $i) | ||
skip=$((header + i * unit)) | ||
dd if="$f" of="t/$f-$n.$ext" bs=1 count="$unit" skip="$skip" | ||
done | ||
done | ||
|
Oops, something went wrong.