#!/bin/bash # Collect detector spike counts from KNP for readout training: run_counts.sh [chunk] M=$1; O=$2; C=${3:-1000} D=/home/int/run/cifar/vehicles export LD_LIBRARY_PATH=$HOME/knp-build/bin:$HOME/deps/lib one() { f=$1; first=$2; n=$3; tag=$4; [ -f $O/${tag}_$first.done ] && return ~/run/altai-objects/altai_infer $D/${f}_images.bin $first $n $M $HOME/knp-build/bin/libknp-cpu-single-threaded-backend.so $O/${tag}_$first > $O/${tag}_$first.log 2>&1 && touch $O/${tag}_$first.done; } export -f one; export M O D { for s in train train_flip; do for i in $(seq 0 $C 15999); do echo "$s $i $C $s"; done; done for i in $(seq 0 $C 3999); do echo "val $i $C val"; done; } | xargs -P ${JOBS:-14} -L 1 bash -c 'one "$@"' _