当前位置: 首页>>代码示例>>Python>>正文


Python logger.warn方法代码示例

本文整理汇总了Python中baselines.logger.warn方法的典型用法代码示例。如果您正苦于以下问题:Python logger.warn方法的具体用法?Python logger.warn怎么用?Python logger.warn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在baselines.logger的用法示例。


在下文中一共展示了logger.warn方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: render

# 需要导入模块: from baselines import logger [as 别名]
# 或者: from baselines.logger import warn [as 别名]
def render(self):
        logger.warn('Render not defined for %s'%self) 
开发者ID:Hwhitetooth,项目名称:lirpg,代码行数:4,代码来源:__init__.py

示例2: render

# 需要导入模块: from baselines import logger [as 别名]
# 或者: from baselines.logger import warn [as 别名]
def render(self, mode='human'):
        logger.warn('Render not defined for %s' % self) 
开发者ID:MaxSobolMark,项目名称:HardRLWithYoutube,代码行数:4,代码来源:__init__.py

示例3: reset

# 需要导入模块: from baselines import logger [as 别名]
# 或者: from baselines.logger import warn [as 别名]
def reset(self):
        if self.waiting_step:
            logger.warn('Called reset() while waiting for the step to complete')
            self.step_wait()
        for pipe in self.parent_pipes:
            pipe.send(('reset', None))
        return self._decode_obses([pipe.recv() for pipe in self.parent_pipes]) 
开发者ID:MaxSobolMark,项目名称:HardRLWithYoutube,代码行数:9,代码来源:shmem_vec_env.py

示例4: load_state

# 需要导入模块: from baselines import logger [as 别名]
# 或者: from baselines.logger import warn [as 别名]
def load_state(fname, sess=None):
    from baselines import logger
    logger.warn('load_state method is deprecated, please use load_variables instead')
    sess = sess or get_session()
    saver = tf.train.Saver()
    saver.restore(tf.get_default_session(), fname) 
开发者ID:quantumiracle,项目名称:Reinforcement_Learning_for_Traffic_Light_Control,代码行数:8,代码来源:tf_util.py

示例5: save_state

# 需要导入模块: from baselines import logger [as 别名]
# 或者: from baselines.logger import warn [as 别名]
def save_state(fname, sess=None):
    from baselines import logger
    logger.warn('save_state method is deprecated, please use save_variables instead')
    sess = sess or get_session()
    dirname = os.path.dirname(fname)
    if any(dirname):
        os.makedirs(dirname, exist_ok=True)
    saver = tf.train.Saver()
    saver.save(tf.get_default_session(), fname)

# The methods above and below are clearly doing the same thing, and in a rather similar way
# TODO: ensure there is no subtle differences and remove one 
开发者ID:quantumiracle,项目名称:Reinforcement_Learning_for_Traffic_Light_Control,代码行数:14,代码来源:tf_util.py

示例6: prepare_params

# 需要导入模块: from baselines import logger [as 别名]
# 或者: from baselines.logger import warn [as 别名]
def prepare_params(kwargs):
    # DDPG params
    ddpg_params = dict()
    env_name = kwargs['env_name']

    def make_env(subrank=None):
        env = gym.make(env_name)
        if subrank is not None and logger.get_dir() is not None:
            try:
                from mpi4py import MPI
                mpi_rank = MPI.COMM_WORLD.Get_rank()
            except ImportError:
                MPI = None
                mpi_rank = 0
                logger.warn('Running with a single MPI process. This should work, but the results may differ from the ones publshed in Plappert et al.')

            max_episode_steps = env._max_episode_steps
            env =  Monitor(env,
                           os.path.join(logger.get_dir(), str(mpi_rank) + '.' + str(subrank)),
                           allow_early_resets=True)
            # hack to re-expose _max_episode_steps (ideally should replace reliance on it downstream)
            env = gym.wrappers.TimeLimit(env, max_episode_steps=max_episode_steps)
        return env

    kwargs['make_env'] = make_env
    tmp_env = cached_make_env(kwargs['make_env'])
    assert hasattr(tmp_env, '_max_episode_steps')
    kwargs['T'] = tmp_env._max_episode_steps

    kwargs['max_u'] = np.array(kwargs['max_u']) if isinstance(kwargs['max_u'], list) else kwargs['max_u']
    kwargs['gamma'] = 1. - 1. / kwargs['T']
    if 'lr' in kwargs:
        kwargs['pi_lr'] = kwargs['lr']
        kwargs['Q_lr'] = kwargs['lr']
        del kwargs['lr']
    for name in ['buffer_size', 'hidden', 'layers',
                 'network_class',
                 'polyak',
                 'batch_size', 'Q_lr', 'pi_lr',
                 'norm_eps', 'norm_clip', 'max_u',
                 'action_l2', 'clip_obs', 'scope', 'relative_goals']:
        ddpg_params[name] = kwargs[name]
        kwargs['_' + name] = kwargs[name]
        del kwargs[name]
    kwargs['ddpg_params'] = ddpg_params

    return kwargs 
开发者ID:openai,项目名称:baselines,代码行数:49,代码来源:config.py


注:本文中的baselines.logger.warn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。