pasky / pachi

A fairly strong Go/Baduk/Weiqi playing program
http://pachi.or.cz/
GNU General Public License v2.0
510 stars 116 forks source link

MM Probs Cleanup #159

Closed lemonsqueeze closed 1 year ago

lemonsqueeze commented 1 year ago

Don't hash pattern feature probabilities by spatial id anymore.

Instead index pattern features so each feature has a gamma number (=index) and lookup pattern probabilities by feature gamma number. This way we can just use a gamma table for lookup.

Make spatial features behave like normal features to make this work (0-based payloads instead of global spatial id). This also makes life a lot easier as we don't have to special case spatial features everywhere, and re-index everything to generate training data. The price to pay is that spatial dictionary must be sorted by distance now (just retrain). Should have done this long ago when introducing MM, but there were so many infrastructure changes already ...

Also improved MAX_PATTERN_AREA, prob and spatial apis and feature_t (no bitfields), should be slightly faster.