1 Star 0 Fork 4

梁少杰0.0/riscv-shared-memory-sgd-old

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test.sh 738 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
total_convergence_time=0
count=0
while IFS= read -r line
do
./cmake-build-debug/mininn $line > temp_output.txt
convergence_time=$(grep "convergence time" temp_output.txt | awk '{print $4}')
# 打印每次的 "convergence time" 值
echo "Run $line: convergence time = $convergence_time"
if [ "$convergence_time" = "No-convergence" ]; then
convergence_time=100
fi
# 累加到总和中
total_convergence_time=$((total_convergence_time + convergence_time))
count=$((count + 1))
done < ./parameter.txt
# 计算平均值
average_convergence_time=$(echo "scale=2; $total_convergence_time / $count" | bc)
# 打印平均值
echo "Average convergence time: $average_convergence_time"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/liang-shaojie-00/riscv-shared-memory-sgd.git
git@gitee.com:liang-shaojie-00/riscv-shared-memory-sgd.git
liang-shaojie-00
riscv-shared-memory-sgd
riscv-shared-memory-sgd-old
master

搜索帮助