Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akikurisu/n-gram-unity
N-Gram implementation in Unity using JobSystem
https://github.com/akikurisu/n-gram-unity
Last synced: 16 days ago
JSON representation
N-Gram implementation in Unity using JobSystem
- Host: GitHub
- URL: https://github.com/akikurisu/n-gram-unity
- Owner: AkiKurisu
- License: mit
- Created: 2023-09-08T06:41:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-07T13:21:06.000Z (about 1 year ago)
- Last Synced: 2023-11-08T04:21:16.504Z (about 1 year ago)
- Language: C#
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# N-Gram
This is an implementation in Unity for N-Gram prediction.Article can be found in
[Implementing N-Grams for Player Prediction, Procedural Generation, and Stylized AI](http://www.gameaipro.com/GameAIPro/GameAIPro_Chapter48_Implementing_N-Grams_for_Player_Prediction_Proceedural_Generation_and_Stylized_AI.pdf) by Joseph Vasquez IIUsing Job System to support muti-thread inference.
## Algorithm
A pseudocode algorithm for finding which N value provides the highest
prediction accuracy for pre-existing event sequences.
```
Instantiate an N-gram for each candidate N value ranged [1,20]
Create accuracy result storage for each N-gram
For each event sequence,
For each event e ∈[0,L-1] in the sequence,
For each N-gram ng,
store result of e compared to ng.Predict()
ng.UpdateWithNewEvent(e)
output accuracy results
output N value of most accurate N-gram based on results
```