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


Python v2.enable_v2_behavior方法代码示例

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


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

示例1: run

# 需要导入模块: from tensorflow.compat import v2 [as 别名]
# 或者: from tensorflow.compat.v2 import enable_v2_behavior [as 别名]
def run(problem_type, max_iter=-1, num_episodes_per_iter=45):
  """Runs the eval_actor with the given problem type.

  Args:
    problem_type: An instance of `framework_problem_type.ProblemType`.
    max_iter: Number of iterations after which the actor must stop. The default
      value of -1 means run indefinitely.
    num_episodes_per_iter: Number of episodes to execute per iteration.
  """

  assert isinstance(problem_type, framework_problem_type.ProblemType)
  tf.enable_v2_behavior()
  hparams = {}
  hparams['logdir'] = FLAGS.logdir
  # In the eval actor, max_iter is only for use unit tests. (It is the learner's
  # job to terminate execution.)
  hparams['max_iter'] = max_iter
  hparams['num_episodes_per_iter'] = num_episodes_per_iter

  run_with_aggregator(problem_type, FLAGS.server_address, hparams) 
开发者ID:google-research,项目名称:valan,代码行数:22,代码来源:eval_actor.py

示例2: setUpModule

# 需要导入模块: from tensorflow.compat import v2 [as 别名]
# 或者: from tensorflow.compat.v2 import enable_v2_behavior [as 别名]
def setUpModule():
  tf.enable_v2_behavior() 
开发者ID:google-research,项目名称:tensor2robot,代码行数:4,代码来源:saved_model_v2_predictor_test.py

示例3: run

# 需要导入模块: from tensorflow.compat import v2 [as 别名]
# 或者: from tensorflow.compat.v2 import enable_v2_behavior [as 别名]
def run(problem_type: framework_problem_type.ProblemType):
  """Runs the learner with the given problem type."""
  tf.enable_v2_behavior()


  iter_frame_ratio = FLAGS.batch_size * FLAGS.unroll_length
  final_iteration = int(
      math.ceil(FLAGS.total_environment_frames / iter_frame_ratio))
  hparams = {}
  hparams['logdir'] = FLAGS.logdir
  hparams['iter_frame_ratio'] = iter_frame_ratio
  hparams['final_iteration'] = final_iteration
  run_with_address(problem_type, FLAGS.server_address, hparams) 
开发者ID:google-research,项目名称:valan,代码行数:15,代码来源:learner.py

示例4: run

# 需要导入模块: from tensorflow.compat import v2 [as 别名]
# 或者: from tensorflow.compat.v2 import enable_v2_behavior [as 别名]
def run(aggregator_prefix='default'):
  """Run the eval_aggregator."""
  tf.enable_v2_behavior()
  hparams = {}
  logdir = FLAGS.logdir
  if aggregator_prefix:
    logdir = os.path.join(logdir, aggregator_prefix)
  hparams['logdir'] = logdir
  hparams['num_samples'] = -1
  run_with_address(FLAGS.server_address, hparams) 
开发者ID:google-research,项目名称:valan,代码行数:12,代码来源:eval_aggregator.py

示例5: run

# 需要导入模块: from tensorflow.compat import v2 [as 别名]
# 或者: from tensorflow.compat.v2 import enable_v2_behavior [as 别名]
def run(problem_type: framework_problem_type.ProblemType):
  """Runs the actor with the given problem type."""
  tf.enable_v2_behavior()
  hparams = {}
  # In the actor, max_iter is only for use unit tests. (It is the learner's job
  # to terminate execution.)
  hparams['max_iter'] = -1  # -1 means infinite
  hparams['sync_agent_every_n_steps'] = FLAGS.sync_agent_every_n_steps
  run_with_learner(problem_type, FLAGS.server_address, hparams) 
开发者ID:google-research,项目名称:valan,代码行数:11,代码来源:actor.py


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