Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Q-table Update with SARSA | Classic RL Algorithms: Q-learning & SARSA
Hands-On Classic RL Algorithms with Python
Секція 1. Розділ 7
single

single

Challenge: Q-table Update with SARSA

Свайпніть щоб показати меню

Завдання

Проведіть, щоб почати кодувати

Given a sequence of state-action pairs, update the Q-table using the SARSA rule.

You are provided with a Q-table, a sequence of (state, action) pairs, a learning rate (alpha), a discount factor (gamma), and a list of rewards received after each transition.

  • For each consecutive pair in the state-action sequence, update the Q-value for the current (state, action) using the SARSA update rule.
  • Use the corresponding reward for each state-action transition.
  • Do not update the final state-action pair, as there is no next state-action following it.
  • Apply the SARSA update: Q[state, action] = Q[state, action] + alpha * (reward + gamma * Q[next_state, next_action] - Q[state, action]).

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 7
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

some-alt