• Tidak ada hasil yang ditemukan

Reinforcement Learning

N/A
N/A
Protected

Academic year: 2023

Membagikan "Reinforcement Learning"

Copied!
157
0
0

Teks penuh

Sensors observe the state of the world - camera and sonar A series of actions can be performed to change the state - move. The robot's job is to perform sequences of actions, observe their consequences, and learn a control policy.

Mapping from state/action pairs to reinforcements After performing an action, the RL agent will receive

RL system designer to define a gain function that correctly defines the RL agent's goals. Sign of the scalar reinforcement indicates whether the terminal state is a goal state (a reward) or a state to be avoided (a punishment).

This may be the case when the gain is a function of limited resources and the agent must. An alternative reinforcement function would be used in the context of a gaming environment when there are two or more players with opposing goals.

An example of a value function can be seen using a simple 16-state Markov decision process. At each time step, the process is in some state s and the decision maker can choose any action a available in state s.

Again, starting in the lower left corner, calculating the sum of gains when running the optimal policy (the policy that will maximize the sum of gains), the value of that state is -3 because only 3 transitions are needed to An . Given the optimal value function, extracting the optimal policy becomes a trivial task.

The approximation of the optimal value function at a given state is equal to the true value of that state V*(xt) plus some error in the approximation. The value of state xt for the optimal policy is the sum of the reinforcements when starting from state xt and.

Markov decision processes (multiple actions possible in a given state) rather than

Markov chains (single action possible in every state)

In practice, it is computationally impossible to calculate the necessary integrals without added knowledge or some degree of modification. Instead of finding a mapping from states to state values ​​(as in value . iteration), Q-learning finds a mapping from state/action pairs to values ​​(called Q-values). The definition of a Q value is the sum of the (possibly discounted) reinforcements received when the associated action is performed and then following the given policy.

The optimal operation is the one that maximizes the sum of r(s,a) and V* up to the immediate successor state, discounted by γ. The agent starts in some state, s, and chooses some action, a, and observes the reward for the outcome, r(s,a), and the new state, δ (s,a). In the context of Q-learning, a state value is defined as the maximum Q-value in a given state.

Given this definition, it is easy to derive the equivalent of the Bellman equation for Q learning.

The Q-value is a prediction of the sum of reinforcements received while performing the associated action and then following the policy. Then find the maximum value of Q in the new state so that you have all the necessary information to revise the prediction (value of Q) associated with . The reason is that a single sample of the successor state for a given action is an unbiased estimate of the expected value of the successor state.

After many updates, the Q value associated with a given action will converge to the expected sum of all reinforcements received when. However, they must be performed in simulators of systems, which can be easily constructed from the distributions of the prevailing random variables. It is known that simulating a complex system is considerably easier than generating a model of the system with all transition probabilities. This is also why RL would avoid the curse of modeling.

Just as it is possible to represent a value function with a neural network in the context of value iteration, a Q-function can be represented with a neural network in the context of Q-learning. The information presented in the value iteration discussion regarding convergence to a stable value function is as well. This can be a real win depending on the relative cost (the robot is very slow compared to replay).

Descending weighted average of current Qˆ and revised estimate (important when r is not . deterministic). The number of training iterations required to sufficiently represent the optimal Q-function when using generalizing function approximators correlates poorly with the size of the time interval between states. The greater the number of actions per unit of time (the smaller the increase in time between actions), the greater the number of training repetitions.

In 1,998 states there are two actions available, transitioning to the state either immediately right or immediately left. For example, in state 1, the action of going left will transition to state 0, and the action of going right will transition to state 2. The objective is to minimize the total cost accumulated while transitioning from state to state until the absorbing state has been achieved.

The optimal Q value for each action is represented by the numbers next to each state. For example, in state 2, the optimal Q value for the action to move left is 1000, and the optimal Q value for the action to move right is 998. The optimal policy can be easily found in any state by making sure to choose the action with the minimum Q value.

The optimal Q function associated with the MDP is linear and can be represented by a simple linear function.

The difference in Q-values ​​within a given state is small relative to the differences in Q-values ​​between states (a ratio of about 1:1000). The approximation of the optimal Q-function must achieve such a degree of accuracy that the small differences in Q-values ​​in each condition are represented. Since differences in Q values ​​between states have a larger impact on the root mean square error, the network learns this during training.

The differences in the Q values ​​in a given mode have only a small effect on the root mean square error and are therefore lost in the noise. Representing the differences in Q values ​​in a given state requires much greater precision than representing the Q values ​​across states. For the state/action pair (x,u), a benefit is defined as the sum of the value of the state and the utility (benefit) of performing action u instead of the current action.

For optimal actions, this utility is zero, meaning that the value of the action is also the value of the state; too suboptimal.

Each state transition returns a cost (gain) of 1 and the value of state 999 is defined as 0. In the context of Markov chains, TD(λ) is identical to value iteration with the exception that TD(λ) is the value update of the current state based on a weighted combination of the.

Recall that in value iteration, the "target" value of the current state is the sum of the gain and the value of . The learning process starts by updating the value of state 0 to be the sum of the gain received at the transition from state 0 to state 1 and the value of state 1. In fact, the approximation will only be done in 999 epochs with training. of the value of state 0 contains any degree of.

In epoch 3, the approximation of state value 996 will be updated based on "truth" rather than an arbitrary value. The approximation of the state value xt is updated based on the approximation of the state value one step into the future, xt+1. If the value of the state was based on a weighted average of the value of future states, the "truth" would spread.

Given that gt is the value of the sum above for t, we can calculate gt+1 using only current information, e.g. The value of the state xt is defined as the sum of the reinforcements received when starting at xt and following the current policy until the final state is reached. However, we may not want the value of the resulting state to propagate through the chain of past states.

SARSA

An important understanding of fitness traces discussed in Singh and Sutton (1996) can be used to increase the power of TD(¸) methods by assigning variable weights to the gains in the update strategy. The discount factor γ is a number in the range of [0,1] and is used to weight gain in the short term more than gain in the distant future. For γ=0, the value of a state is based solely on the instantaneous gain received for performing the associated action.

For Markov decision processes with finite horizons (an MDP that ends) it is not strictly necessary to use a discount factor. In this case (γ=1) the value of state xt is based on the total reinforcement received when starting in state xt and following the given policy. In the case of Markov decision processes with infinite horizons (an MDP that never ends), a discount factor is required.

The use of a discount factor limits the maximum value of a mode to be of the order of R/1−γ. Where rt+i is generated by starting at state st and repeatedly using policy π to select actions. 0 ≤ γ < 1 is a constant that determines the relative value of delayed versus immediate rewards—if only γ=0.

Focused on how to calculate the optimal policy with the least computational effort, assuming that the environment can be simulated. Focused on the number of actual actions the agent must perform to converge to an acceptable policy. In many practical domains, such as manufacturing problems, the cost in dollars and time of.

Reinforcement learning algorithms adapt to Markov decision processes where the outcome of applying an action to a state depends only on this action and state (not previous actions or states). Q learning is a form of reinforcement learning where the function Q(s,a) is defined as the maximum. Learning Q is proven to converge under certain assumptions when the hypothesis Qˆ(s,a) is represented by a lookup table.

Referensi

Dokumen terkait

THE ENVIRONMENTAL AND HEALTH SUSTAINABILITY CHALLENGES OF MALAYSIAN PALM OIL IN THE EUROPEAN UNION as feedstock for biodiesel production may be negatively affected by the political