rcognita.critics.CriticTrivial

class rcognita.critics.CriticTrivial(running_objective, *args, sampling_time=0.01, **kwargs)

This is a dummy to calculate outcome (accumulated running objective).

__init__(running_objective, *args, sampling_time=0.01, **kwargs)

Initialize a trivial critic.

Parameters
  • running_objective (function) – Function object representing the running objective.

  • sampling_time (float) – Sampling time.

  • args – Additional arguments.

  • kwargs – Additional keyword arguments.

Methods

__init__(running_objective, *args[, …])

Initialize a trivial critic.

accept_or_reject_weights(weights[, …])

Determine whether to accept or reject the given weights based on whether they violate the given constraints.

cache_weights([weights])

Stores a copy of the current model weights.

get_optimized_weights([…])

Dummy method to return optimized weights.

initialize_buffers()

Initialize the action and observation buffers with zeros.

objective(weights)

Dummy method for the objective function.

optimize_weights([time])

Compute optimized critic weights, possibly subject to constraints.

reset()

Reset the outcome variable to zero.

restore_weights()

Restores the model weights to the cached weights.

update([intrinsic_constraints, observation, …])

Dummy method for updating the critic.

update_and_cache_weights([weights])

Update the model’s weights and cache the new values.

update_buffers(observation, action)

Updates the outcome.

update_outcome(observation, action)

Update the value of the outcome variable by adding the value of the running_objective function evaluated at the current observation and action, multiplied by the sampling time.

update_target(new_target)

update_weights([weights])

Update the weights of the critic model.

Attributes

optimizer_engine

Returns the engine used by the optimizer.