QDpy
Loading...
Searching...
No Matches
sfols.py File Reference

Build a tabular successor-feature repertoire using optimistic linear support. More...

Go to the source code of this file.

Classes

class  qdpy.algorithms.sfols.SFOLSResult
 A policy repertoire, solved reward weights, and the residual optimistic gap. More...

Namespaces

namespace  qdpy

Functions

 qdpy.algorithms.sfols.tabular_optimal_policy (continuation, features, reward_weights, *, gamma=.99)
 Compute a deterministic scalar-optimal policy by finite-state policy iteration.
 qdpy.algorithms.sfols._corners (values)
 qdpy.algorithms.sfols.tabular_sfols (continuation, features, start, *, gamma=.99, max_policy_solves=32, tolerance=1e-7)
 Learn a finite-state policy repertoire for a simplex of linear rewards.

Detailed Description

Build a tabular successor-feature repertoire using optimistic linear support.

See also
https://proceedings.mlr.press/v162/alegre22a.html

Definition in file sfols.py.

Function Documentation

◆ _corners()

qdpy.algorithms.sfols._corners ( values)
protected
Enumerate vertices of each policy's region on the reward simplex.

Definition at line 74 of file sfols.py.

◆ tabular_optimal_policy()

qdpy.algorithms.sfols.tabular_optimal_policy ( continuation,
features,
reward_weights,
* ,
gamma = .99 )

Compute a deterministic scalar-optimal policy by finite-state policy iteration.

Return the integer action table for a fixed linear reward.

Definition at line 64 of file sfols.py.

◆ tabular_sfols()

qdpy.algorithms.sfols.tabular_sfols ( continuation,
features,
start,
* ,
gamma = .99,
max_policy_solves = 32,
tolerance = 1e-7 )

Learn a finite-state policy repertoire for a simplex of linear rewards.

Parameters
continuationSubstochastic transition array [state, action, state].
featuresExpected immediate feature array [state, action, feature].
startInitial-state probability vector.
gammaDiscount in [0, 1).
max_policy_solvesHard cap on scalar optimal-policy queries.
toleranceTarget absolute gap in discounted reward.
Returns
Supported policies, their successor features, and search accounting.
Solve the most promising corner of the current policy envelope next.

The search first solves unit reward weights. For each corner of
the current piecewise-linear value envelope, a linear program
bounds the value of any unknown policy using the solved tasks.
Numerical roundoff in policy evaluation is tracked through
a Bellman residual bound. Corner enumeration is intended for small
reward spaces. Auditing uses the supplied start distribution.

Definition at line 107 of file sfols.py.