TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Namespaces | Classes | Typedefs | Functions | Variables
cpid Namespace Reference

The TorchCraftAI training library. More...

Namespaces

 detail
 
 distributed
 
 netutils
 

Classes

class  AsyncBatcher
 
class  BaseSampler
 A sampler takes the output of the model, and outputs an action accordingly. More...
 
struct  BatchedPGReplayBufferFrame
 
class  BatchedPGTrainer
 Off policy policy gradient with a critic. More...
 
class  BlobPublisher
 Publisher for ZeroMQ PUB-SUB pattern. More...
 
class  BlobStorage
 A simple interface for key-value data blob stores. More...
 
class  BlobStorageDisk
 
class  BlobStorageRedis
 Blob storage in Redis. More...
 
class  BlobSubscriber
 Subscriber for ZeroMQ PUB-SUB pattern. More...
 
class  CentralCpid2kTrainer
 A trainer that sends episodes to one or more central instances. More...
 
class  CentralTrainer
 A trainer that sends episodes to one or more central instances. More...
 
class  Checkpointer
 
class  ContinuousDeterministicSampler
 This sampler expects as input an unordered_map<string, Variant> containing an entry policyKey, which is a tensor of size [b, n]. More...
 
class  ContinuousGaussianSampler
 This sampler expects as input an unordered_map<string, Variant>, containing an entry policyKey, which is a tensor of size [b, n]. More...
 
class  Cpid2kGlobalState
 Encapsulates information about the participating peers in a cpid2k job. More...
 
class  Cpid2kHeartBeater
 Periodically sends out heartbeats to a Redis instance. More...
 
class  Cpid2kMetrics
 Helper class to aggregate metrics locally, and send them reguarly as events in the redis database as key 'prefix:metricEvents'. More...
 
class  Cpid2kWorker
 Helper class for job coordination via a central Redis instance. More...
 
struct  Cpid2kWorkerInfo
 
class  DiscreteMaxSampler
 This sampler expects as input an unordered_map<string, Variant>, containing an entry QKey, which is a tensor of size [b, n]. More...
 
struct  EpisodeData
 
struct  EpisodeTuple
 
class  EpsGreedySampler
 This sampler expects as input an unordered_map<string, Variant> containing an entry QKey, which is a tensor of size [b, n]. More...
 
class  ESTrainer
 
class  Evaluator
 
struct  HandleGuard
 
class  MetricsContext
 
class  MultinomialSampler
 This sampler expects as input an unordered_map<string, Variant>, which contains an entry policyKey, which is a tensor of size [b, n]. More...
 
struct  OnlineZORBReplayBufferFrame
 State, Action taken, reward Taking in an additional action taken allows you to not just take the max action, but use your own inference strategy, for example, if some actions are invalid. More...
 
class  OnlineZORBTrainer
 This is a OnlineZORBTrainer that works with multiple actions per frame. More...
 
struct  pairhash
 
class  permanent_lock
 This exactly a unique lock that doesn't unlock on delete. More...
 
class  priority_lock
 This is exactly an unique_lock without automatic lock, except that the lock functions accepts a priority. More...
 
class  priority_mutex
 This class implements a mutex that offers some control over the priority of the waiting threads. More...
 
class  RedisClient
 Simple, synchronous C++ wrapper for the Hiredis Redis client. More...
 
class  RedisReply
 Wrapper class for redisReply from Hiredis. More...
 
class  RedisStore
 c10d::Store for rendez-vous backed by Redis. More...
 
class  ReplayBuffer
 Stores an unordered_map[GameUID] = unordered_map[int, Episode] All the public functions here should be autolocking and therefore relatively thread safe. More...
 
struct  ReplayBufferFrame
 Stub base class for replay buffer frames. More...
 
class  ReqRepClient
 A request-reply client backed by ZeroMQ. More...
 
class  ReqRepServer
 A request-reply server backed by ZeroMQ. More...
 
struct  RewardBufferFrame
 
class  SubBatchAsyncBatcher
 A batcher that can operate on (already) batched data Should be used when features have a variable batch dimension, for instance the number of units controlled. More...
 
class  Trainer
 The Trainer should be shared amongst multiple different nodes, and attached to a single Module. More...
 
class  ZeroMQBufferedConsumer
 A buffered consumer that sends data via ZeroMQ. More...
 
class  ZeroMQBufferedProducer
 A buffered producer that obtains data via ZeroMQ. More...
 
class  ZOBackpropModel
 See trainer for output format of these models. More...
 

Typedefs

using EpisodeServer = ZeroMQBufferedProducer< EpisodeData >
 
using EpisodeClient = ZeroMQBufferedConsumer< EpisodeData >
 
using GameUID = std::string
 
using EpisodeKey = std::string
 
using EpisodeHandle = Trainer::EpisodeHandle
 

Functions

 DEFINE_FLAG_OPERATORS (BlobPublisher::DataFlags)
 
float kaiming_normal_ (torch::Tensor tensor, double gain)
 
ag::Optimizer selectOptimizer (std::shared_ptr< torch::nn::Module > module)
 
std::map< std::string, std::string > optimizerFlags ()
 
GameUID genGameUID ()
 
std::ostream & operator<< (std::ostream &os, EpisodeHandle const &handle)
 

Variables

const constexpr auto kDefaultEpisodeKey = ""
 
const std::string kValueKey = "V"
 
const std::string kQKey = "Q"
 
const std::string kPiKey = "Pi"
 
const std::string kSigmaKey = "std"
 
const std::string kActionQKey = "actionQ"
 
const std::string kActionKey = "action"
 
const std::string kPActionKey = "pAction"
 

Detailed Description

The TorchCraftAI training library.

Typedef Documentation

using cpid::EpisodeKey = typedef std::string
using cpid::GameUID = typedef std::string

Function Documentation

cpid::DEFINE_FLAG_OPERATORS ( BlobPublisher::DataFlags  )
GameUID cpid::genGameUID ( )
float cpid::kaiming_normal_ ( torch::Tensor  tensor,
double  gain 
)
std::ostream& cpid::operator<< ( std::ostream &  os,
EpisodeHandle const &  handle 
)
std::map< std::string, std::string > cpid::optimizerFlags ( )
ag::Optimizer cpid::selectOptimizer ( std::shared_ptr< torch::nn::Module >  module)

Variable Documentation

const std::string cpid::kActionKey = "action"
inline
const std::string cpid::kActionQKey = "actionQ"
inline
const constexpr auto cpid::kDefaultEpisodeKey = ""
const std::string cpid::kPActionKey = "pAction"
inline
const std::string cpid::kPiKey = "Pi"
inline
const std::string cpid::kQKey = "Q"
inline
const std::string cpid::kSigmaKey = "std"
inline
const std::string cpid::kValueKey = "V"
inline