API del Producte - Treball Final de Màster
by Rafael Jesús Castaño Ribes, January 2021

Els mètodes derivats, si no ha estat sobreescrita, hereten la documentació de les seves superclasses. L'autoria de la documentació en aquests casos correspon al desenvolupador de la superclasse.
index -> experiments.off_p_tsb_experiment
index
..\src\experiments\off_p_tsb_experiment.py

Train and Eval class for off-policy TD learning agents feeded with batches of experiences from a replay buffer.
Attribution: 
  This class is an adaptation of the module train_eval.py from the SAC Agent examples from the TF-Agents library:
    https://github.com/tensorflow/agents/blob/v0.6.0/tf_agents/agents/sac/examples/v2/train_eval.py
  Copyrighted 2020 by the TF-Agents Authors and licensed under the Apache License, Version 2.0.
Changes added to the original code:
  The code has been given a class format and has been generalized to work with any off-policy TD based TF-Agent, wich will have to be provided by 
  subclasses via the method _get_the_agent().
  Moreover, a method called create_video has been added allowing the class to generate a video by playing the obtained exploitation policy on the environment. This method has been adapted from the example code provided by 
  Holt, S. (2020). Value and Policy based agents: https://pathtopioneer.com/blog/2020/07/rl-4, licensed under a Creative Commons CC BY-NC-SA 4.0 license.

 
Modules
       
tf_agents.utils.common
tf_agents.drivers.dynamic_step_driver
tf_agents.policies.greedy_policy
imageio
absl.logging
tf_agents.eval.metric_utils
os
tf_agents.agents.random.random_agent
tf_agents.policies.random_tf_policy
tf_agents.environments.suite_gym
tensorflow
tf_agents.metrics.tf_metrics
tf_agents.environments.tf_py_environment
tf_agents.replay_buffers.tf_uniform_replay_buffer
time

 
Classes
       
builtins.object
OffPolicyTimeStepBasedExperiment

 
class OffPolicyTimeStepBasedExperiment(builtins.object)
    OffPolicyTimeStepBasedExperiment(root_dir='', num_eval_episodes=10, summary_interval=1000, env_name='BipedalWalker-v3', env_action_repeat_times=4, debug_summaries=False, summarize_grads_and_vars=False, replay_buffer_capacity=1000000, initial_collect_steps=10000, collect_steps_per_iteration=1, use_tf_functions=True, sample_batch_size=256, num_iterations=3000000, train_steps_per_iteration=1, log_interval=1000, eval_interval=10000, train_checkpoint_interval=50000, policy_checkpoint_interval=50000, replay_buffer_checkpoint_interval=50000, name='default_naf_experiment')
 
A simple train and eval class for Off-Policy TimeStep based Agents
 
  Methods defined here:
__init__(self, root_dir='', num_eval_episodes=10, summary_interval=1000, env_name='BipedalWalker-v3', env_action_repeat_times=4, debug_summaries=False, summarize_grads_and_vars=False, replay_buffer_capacity=1000000, initial_collect_steps=10000, collect_steps_per_iteration=1, use_tf_functions=True, sample_batch_size=256, num_iterations=3000000, train_steps_per_iteration=1, log_interval=1000, eval_interval=10000, train_checkpoint_interval=50000, policy_checkpoint_interval=50000, replay_buffer_checkpoint_interval=50000, name='default_naf_experiment')
Initialize self.  See help(type(self)) for accurate signature.
copy(self)
launch(self)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
division = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)
print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)