agent_mjc.py 文件源码

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

项目:lsdc 作者: febert 项目源码 文件源码
def save_goal_image(self, traj):
        rounded = np.around(traj.score, decimals=2)
        best_score = np.min(rounded)
        for i in range(traj.score.shape[0]):
            if rounded[i] == best_score:
                first_best_index = i
                break

        print 'best_score', best_score
        print 'allscores', traj.score
        print 'goal index: ', first_best_index

        goalimage = traj._sample_images[first_best_index]
        # goalstate = traj.X_Xdot_full[i]
        img = Image.fromarray(goalimage)

        cPickle.dump([], open(self._hyperparams['save_goal_image'] + '.pkl', 'wb'))
        img.save(self._hyperparams['save_goal_image'] + '.png',)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号