Skip to content

N-Gram implementation in Unity using JobSystem

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

AkiKurisu/N-Gram-Unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 by Joseph Vasquez II

Using 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

About

N-Gram implementation in Unity using JobSystem

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages