Exemplo n.º 1
0
    def __init__(self,
                 from_=None,
                 to_=None,
                 start_timestep=0,
                 num_timesteps=10000,
                 scope="decay",
                 **kwargs):
        """
        Args:
            from_ (float): The max value returned between 0 and `start_timestep`.
            to_ (float): The min value returned from [`start_timestep`+`num_timesteps`] onwards.
            start_timestep (int): The timestep at which to start the decay process.
            num_timesteps (int): The number of time steps over which to decay. Outputs will be stationary before and
                after this decaying period.

        Keyword Args:
            from (float): See `from_`. For additional support to specify without the underscore.
            to (float): See `to_`. For additional support to specify without the underscore.
        """
        raise RLGraphObsoletedError("DecayComponent", "DecayComponent",
                                    "TimeDependentParameter")
        kwargs_from = kwargs.pop("from", None)
        kwargs_to = kwargs.pop("to", None)

        super(DecayComponent, self).__init__(scope=scope, **kwargs)

        self.from_ = kwargs_from if kwargs_from is not None else from_ if from_ is not None else 1.0
        self.to_ = kwargs_to if kwargs_to is not None else to_ if to_ is not None else 0.0
        self.start_timestep = start_timestep
        self.num_timesteps = num_timesteps
Exemplo n.º 2
0
    def __init__(self, constant_value, scope="constant-decay", **kwargs):
        """
        Args:
            constant_value (float): Constant value for exploration.
        """
        raise RLGraphObsoletedError("DecayComponent", "ConstantDecay",
                                    "Constant")

        super(ConstantDecay, self).__init__(scope=scope, **kwargs)
        self.constant_value = constant_value
Exemplo n.º 3
0
    def __init__(self, decay_rate=0.1, scope="exponential-decay", **kwargs):
        """
        Args:
            decay_rate (float): The percentage of the original value after 100% of the time has been reached (see
                formula above).
                >0.0: The smaller the decay-rate, the stronger the decay.
                1.0: No decay at all.
        """
        # Obsoleted decay component args:
        if "half_life" in kwargs:
            raise RLGraphObsoletedError(
                "ExponentialDecay", "half_life",
                "decay_rate (according to to_ + (from_ - to_) * decay_rate ** `time_percentage`)"
            )
        elif "num_half_lives" in kwargs:
            raise RLGraphObsoletedError(
                "ExponentialDecay", "num_half_lives",
                "decay_rate (according to to_ + (from_ - to_) * decay_rate ** `time_percentage`)"
            )

        super(ExponentialDecay, self).__init__(scope=scope, **kwargs)

        self.decay_rate = decay_rate
Exemplo n.º 4
0
 def get_logits_probabilities_log_probs(self, nn_input, original_nn_input=None):
     raise RLGraphObsoletedError(
         "API method", "get_logits_probabilities_log_probs", "get_logits_parameters_log_probs"
     )
Exemplo n.º 5
0
 def get_nn_output(self, nn_inputs):
     raise RLGraphObsoletedError("API-method", "get_nn_output", "get_nn_outputs")
Exemplo n.º 6
0
 def get_action_layer_output(self, nn_inputs):
     raise RLGraphObsoletedError("API-method", "get_action_layer_output", "get_adapter_outputs")
Exemplo n.º 7
0
 def get_action_log_probs(self, nn_inputs, actions):
     raise RLGraphObsoletedError("API-method", "get_action_log_probs", "get_log_likelihood")
Exemplo n.º 8
0
 def get_action_and_log_params(self, nn_inputs, internal_states=None, deterministic=None):
     raise RLGraphObsoletedError("API-method", "get_action_and_log_params", "get_action_and_log_likelihood")
Exemplo n.º 9
0
 def get_logits_probabilities_log_probs(self, nn_inputs, internal_states=None):
     raise RLGraphObsoletedError("API-method", "get_logits_probabilities_log_probs",
                                 "get_adapter_outputs_and_parameters")
Exemplo n.º 10
0
 def get_parameters_log_probs(self, logits):
     raise RLGraphObsoletedError("API-method", "get_parameters_log_probs", "get_parameters_from_adapter_outputs")
Exemplo n.º 11
0
 def get_logits(self, nn_input, original_nn_input=None):
     raise RLGraphObsoletedError("API-method", "get_logits", "call")
Exemplo n.º 12
0
 def get_state_values_logits_probabilities_log_probs(
         self, nn_input, internal_states=None):
     raise RLGraphObsoletedError(
         "API method", "get_state_values_logits_probabilities_log_probs",
         "get_state_values_logits_parameters_log_probs")