Skip to main content

Crate little_sorry

Crate little_sorry 

Source
Expand description

§Little Sorry

Regret minimization algorithms for finding Nash equilibrium strategies in imperfect-information games.

§Available Algorithms

All algorithms implement the RegretMinimizer trait:

TypeAlgorithmKey Property
CfrPlusRegretMatcherCFR+Regret clipping at zero
DiscountedRegretMatcherDCFRConfigurable time-based discounting
DcfrPlusRegretMatcherDCFR+DCFR discounting + CFR+ clipping
LinearCfrRegretMatcherLinear CFRLinear time-weighted regrets
PcfrPlusRegretMatcherPCFR+Predictive future regret estimates
PdcfrPlusRegretMatcherPDCFR+DCFR+ discounting + predictive updates

§Quick Start

use little_sorry::{CfrPlusRegretMatcher, RegretMinimizer};

let mut matcher = CfrPlusRegretMatcher::new(3);
for _ in 0..1000 {
    matcher.update_regret(&[1.0, -0.5, 0.2]);
}
let strategy = matcher.best_weight();
assert!((strategy.iter().sum::<f32>() - 1.0).abs() < 1e-6);

Re-exports§

pub use cfr_plus::CfrPlusRegretMatcher;
pub use dcfr::DiscountedRegretMatcher;
pub use dcfr_plus::DcfrPlusRegretMatcher;
pub use discount::DiscountParams;
pub use linear_cfr::LinearCfrRegretMatcher;
pub use pcfr_plus::PcfrPlusRegretMatcher;
pub use pdcfr_plus::PdcfrPlusRegretMatcher;
pub use regret_minimizer::RegretMinimizer;
pub use cfr_plus::CfrPlusRegretMatcher as RegretMatcher;

Modules§

cfr_plus
CFR+ regret minimization implementation.
dcfr
Discounted CFR (DCFR) implementation.
dcfr_plus
DCFR+ (Discounted CFR+) implementation.
discount
Discount parameter configurations for DCFR variants.
linear_cfr
Linear CFR implementation.
pcfr_plus
PCFR+ (Predictive CFR+) implementation.
pdcfr_plus
PDCFR+ (Predictive Discounted CFR+) implementation.
regret_minimizer
Trait definition and shared helpers for regret minimization algorithms.