TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
|
Classes | |
struct | ModelRunner |
Helper class for running BOS models. More... | |
struct | Sample |
struct | StaticData |
Enumerations | |
enum | BosFeature { BosFeature::Undef, BosFeature::Map, BosFeature::MapId, BosFeature::Race, BosFeature::Units, BosFeature::BagOfUnitCounts, BosFeature::BagOfUnitCountsAbs5_15_30, BosFeature::Resources5Log, BosFeature::TechUpgradeBits, BosFeature::PendingTechUpgradeBits, BosFeature::TimeAsFrame, BosFeature::ActiveBo, BosFeature::NextBo } |
A list of possible features that can be extracted from a Sample. More... | |
Functions | |
ag::Container | modelMakeFromCli (double dropout=0.0) |
Construct a BOS module according to command-line flags. More... | |
std::map< std::string, std::string > | modelFlags () |
AUTOGRAD_CONTAINER_CLASS (IdleModel) | |
AUTOGRAD_CONTAINER_CLASS (MapRaceEcoTimeFeaturize) | |
AUTOGRAD_CONTAINER_CLASS (LinearModel) | |
AUTOGRAD_CONTAINER_CLASS (MlpModel) | |
AUTOGRAD_CONTAINER_CLASS (LstmModel) | |
AUTOGRAD_CONTAINER_CLASS (ConvEncLstmModel) | |
std::unique_ptr< ModelRunner > | makeModelRunner (ag::Container model, std::string modelType) |
std::map< std::string, int64_t > const & | buildOrderMap () |
std::vector< std::string > const & | targetBuilds () |
std::string | allowedTargetsAsFlag () |
std::string | allowedOpeningsAsFlag () |
torch::Tensor | getBuildOrderMaskByRace (char race) |
torch::Tensor | getBuildOrderMaskByRace (int race) |
int64_t | mapId (torch::Tensor mapFeats) |
char | getOpponentRace (std::string const &opponent) |
std::string | addRacePrefix (std::string buildOrder, char prefix) |
std::string | addRacePrefix (std::string buildOrder, int race) |
std::string | stripRacePrefix (std::string prefixedBo) |
int64_t | buildOrderId (std::string const &bo) |
|
strong |
A list of possible features that can be extracted from a Sample.
Enumerator | |
---|---|
Undef | |
Map |
Map features from StaticData. |
MapId |
Map "ID" based on sum of map features. |
Race |
2-dimensional: our and their race |
Units |
Defogger-style pooled unit types. |
BagOfUnitCounts |
Bag-of-words unit type counts. |
BagOfUnitCountsAbs5_15_30 |
Bag-of-words unit type counts in future autobuild states (ours only) |
Resources5Log |
Ore/Gas/UsedPsi/TotalPsi: log(x / 5 + 1) |
TechUpgradeBits |
142-dim tech/upgrade vector: one bit for each upgrade/level/tech |
PendingTechUpgradeBits |
142-dim vector of pending upgrades/techs |
TimeAsFrame |
Numerical frame value. |
ActiveBo |
Id of active build order. |
NextBo |
Id of next build order. |
|
inline |
|
inline |
std::string cherrypi::bos::allowedOpeningsAsFlag | ( | ) |
std::string cherrypi::bos::allowedTargetsAsFlag | ( | ) |
cherrypi::bos::AUTOGRAD_CONTAINER_CLASS | ( | IdleModel | ) |
cherrypi::bos::AUTOGRAD_CONTAINER_CLASS | ( | MapRaceEcoTimeFeaturize | ) |
Expected input:
B can also be TxB.
Returns:
cherrypi::bos::AUTOGRAD_CONTAINER_CLASS | ( | LinearModel | ) |
Expected input: Dictionary with "features" as tensor vector:
Returns an unordered_map:
cherrypi::bos::AUTOGRAD_CONTAINER_CLASS | ( | MlpModel | ) |
Expected input: Dictionary with "features" as tensor vector:
Returns an unordered_map:
cherrypi::bos::AUTOGRAD_CONTAINER_CLASS | ( | LstmModel | ) |
Expected input: Dictionary with "features" as tensor vector:
The 'T' dimension may be omitted.
Returns an unordered_map:
cherrypi::bos::AUTOGRAD_CONTAINER_CLASS | ( | ConvEncLstmModel | ) |
Expected input: Dictionary with "features" as tensor vector:
The 'T' dimension may be omitted.
Returns an unordered_map:
|
inline |
std::map< std::string, int64_t > const & cherrypi::bos::buildOrderMap | ( | ) |
torch::Tensor cherrypi::bos::getBuildOrderMaskByRace | ( | char | race | ) |
torch::Tensor cherrypi::bos::getBuildOrderMaskByRace | ( | int | race | ) |
|
inline |
std::unique_ptr< ModelRunner > cherrypi::bos::makeModelRunner | ( | ag::Container | model, |
std::string | modelType | ||
) |
int64_t cherrypi::bos::mapId | ( | torch::Tensor | mapFeats | ) |
std::map< std::string, std::string > cherrypi::bos::modelFlags | ( | ) |
ag::Container cherrypi::bos::modelMakeFromCli | ( | double | dropout | ) |
Construct a BOS module according to command-line flags.
|
inline |
std::vector< std::string > const & cherrypi::bos::targetBuilds | ( | ) |