evaluate.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:NMT 作者: tuzhaopeng 项目源码 文件源码
def load_timings(path, args, y):
    logging.debug("Loading timings from {}".format(path))
    tm = numpy.load(path)
    num_steps = min(tm['step'], args.finish)
    df = pandas.DataFrame({k : tm[k] for k in [y, 'time_step']})[args.start:num_steps]
    one_step = df['time_step'].median() / 3600.0
    logging.debug("Median time for one step is {} hours".format(one_step))
    if args.hours:
        df.index = (args.start + numpy.arange(0, df.index.shape[0])) * one_step
    return pandas.rolling_mean(df, args.window).iloc[args.window:]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号