QDpy
Loading...
Searching...
No Matches
qdpy.algorithms.occupancy_me.OccupancyHistogram Class Reference

Count nearest-centroid visits along a fixed-width trajectory. More...

Public Member Functions

 state_centroids (self)
 bins (self)
 observation_size (self)
 fit (cls, reference_states, bins, *, seed=0)
 Fit the state tessellation to caller-supplied reference rows.
 encode (self, trajectory)
 Encode one trajectory as normalized state-bin visits.
 make_archive (self, cells, *, fitness_domain=(-np.inf, np.inf), fitness_weight=1., centroids=None, seed=0)
 Build a native CVT repertoire over the descriptor probability simplex.

Detailed Description

Count nearest-centroid visits along a fixed-width trajectory.

Build a frequency descriptor using fixed state or state-action centroids.

Each row has one state or state-action observation. Assign it to its
nearest Euclidean centroid and normalize the counts by trajectory
length. The order of visits does not affect the result. Ties go to
the first centroid.

:param state_centroids: Matrix with one row per state bin and one
    column per observed coordinate.

Definition at line 30 of file occupancy_me.py.

Member Function Documentation

◆ bins()

qdpy.algorithms.occupancy_me.OccupancyHistogram.bins ( self)
Count state bins, which is also the descriptor width.

Definition at line 54 of file occupancy_me.py.

◆ encode()

qdpy.algorithms.occupancy_me.OccupancyHistogram.encode ( self,
trajectory )

Encode one trajectory as normalized state-bin visits.

Return a probability vector with one component per state bin.

Definition at line 79 of file occupancy_me.py.

◆ fit()

qdpy.algorithms.occupancy_me.OccupancyHistogram.fit ( cls,
reference_states,
bins,
* ,
seed = 0 )

Fit the state tessellation to caller-supplied reference rows.

Return a fixed state partition from seeded k-means on reference observations.

Definition at line 65 of file occupancy_me.py.

◆ make_archive()

qdpy.algorithms.occupancy_me.OccupancyHistogram.make_archive ( self,
cells,
* ,
fitness_domain = (-np.inf, np.inf),
fitness_weight = 1.,
centroids = None,
seed = 0 )

Build a native CVT repertoire over the descriptor probability simplex.

Use explicit probability vectors or draw uniform Dirichlet centroids.

Definition at line 100 of file occupancy_me.py.

◆ observation_size()

qdpy.algorithms.occupancy_me.OccupancyHistogram.observation_size ( self)
Number of state or state-action coordinates per trajectory row.

Definition at line 59 of file occupancy_me.py.

◆ state_centroids()

qdpy.algorithms.occupancy_me.OccupancyHistogram.state_centroids ( self)
Return a copy of the state-bin centroids.

Definition at line 49 of file occupancy_me.py.


The documentation for this class was generated from the following file: