Module: tf_agents.bandits.agents.utils

View source on GitHub

Common utility code and linear algebra functions.

Functions

build_laplacian_nearest_neighbor_graph(...): Build the Laplacian matrix of a nearest neighbor graph.

build_laplacian_over_ordinal_integer_actions(...): Build the unnormalized Laplacian matrix over ordinal integer actions.

compute_pairwise_distances(...): Compute the pairwise distances matrix.

get_num_actions_from_tensor_spec(...): Validates action_spec and returns number of actions.

sum_reward_weighted_observations(...): Calculates an update used by some Bandit algorithms.