ding.league.algorithm¶
ding.league.algorithm
¶
pfsp(win_rates, weighting)
¶
Overview
Prioritized Fictitious Self-Play algorithm. Process win_rates with a weighting function to get priority, then calculate the selection probability of each.
Arguments:
- win_rates (:obj:np.ndarray): a numpy ndarray of win rates between one player and N opponents, shape(N)
- weighting (:obj:str): pfsp weighting function type, refer to weighting_func below
Returns:
- probs (:obj:np.ndarray): a numpy ndarray of probability at which one element is selected, shape(N)
uniform(win_rates)
¶
Overview
Uniform opponent selection algorithm. Select an opponent uniformly, regardless of historical win rates.
Arguments:
- win_rates (:obj:np.ndarray): a numpy ndarray of win rates between one player and N opponents, shape(N)
Returns:
- probs (:obj:np.ndarray): a numpy ndarray of uniform probability, shape(N)
Full Source Code
../ding/league/algorithm.py