Skip to content
代码片段 群组 项目
提交 e9a410b5 编辑于 作者: AngelBottomless's avatar AngelBottomless 提交者: AUTOMATIC1111
浏览文件

check length for variance

上级 0d2e1dac
No related branches found
No related tags found
无相关合并请求
...@@ -271,9 +271,17 @@ def stack_conds(conds): ...@@ -271,9 +271,17 @@ def stack_conds(conds):
def statistics(data): def statistics(data):
total_information = f"loss:{mean(data):.3f}"+u"\u00B1"+f"({stdev(data)/ (len(data)**0.5):.3f})" if len(data) < 2:
std = 0
else:
std = stdev(data)
total_information = f"loss:{mean(data):.3f}" + u"\u00B1" + f"({std/ (len(data) ** 0.5):.3f})"
recent_data = data[-32:] recent_data = data[-32:]
recent_information = f"recent 32 loss:{mean(recent_data):.3f}"+u"\u00B1"+f"({stdev(recent_data)/ (len(recent_data)**0.5):.3f})" if len(recent_data) < 2:
std = 0
else:
std = stdev(recent_data)
recent_information = f"recent 32 loss:{mean(recent_data):.3f}" + u"\u00B1" + f"({std / (len(recent_data) ** 0.5):.3f})"
return total_information, recent_information return total_information, recent_information
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册