A class that is capable of representing a generic mapping from EventType (which is a vector of (key, value) pairs) to EventAnswerType which is just an integer. More...
#include <event-map.h>
Public Member Functions | |
virtual bool | Map (const EventType &event, EventAnswerType *ans) const =0 |
virtual void | MultiMap (const EventType &event, std::vector< EventAnswerType > *ans) const =0 |
virtual void | GetChildren (std::vector< EventMap *> *out) const =0 |
virtual EventMap * | Copy (const std::vector< EventMap *> &new_leaves) const =0 |
EventMap * | Copy () const |
virtual EventMap * | MapValues (const unordered_set< EventKeyType > &keys_to_map, const unordered_map< EventValueType, EventValueType > &value_map) const =0 |
virtual EventMap * | Prune () const =0 |
virtual EventAnswerType | MaxResult () const |
virtual void | Write (std::ostream &os, bool binary)=0 |
Write to stream. More... | |
virtual | ~EventMap () |
Static Public Member Functions | |
static void | Check (const EventType &event) |
static bool | Lookup (const EventType &event, EventKeyType key, EventValueType *ans) |
static void | Write (std::ostream &os, bool binary, EventMap *emap) |
a Write function that takes care of NULL pointers. More... | |
static EventMap * | Read (std::istream &is, bool binary) |
a Read function that reads an arbitrary EventMap; also works for NULL pointers. More... | |
A class that is capable of representing a generic mapping from EventType (which is a vector of (key, value) pairs) to EventAnswerType which is just an integer.
See Decision tree internals for overview.
Definition at line 86 of file event-map.h.
|
inlinevirtual |
Definition at line 156 of file event-map.h.
|
static |
Definition at line 281 of file event-map.cc.
References rnnlm::i, and KALDI_ASSERT.
Referenced by EventMap::Lookup(), kaldi::TestQuestionsInitRand(), and kaldi::TestSplitDecisionTree().
Implemented in SplitEventMap, TableEventMap, and ConstantEventMap.
Referenced by kaldi::ClusterEventMap(), kaldi::ClusterEventMapRestrictedByKeys(), kaldi::ClusterEventMapRestrictedByMap(), kaldi::ClusterEventMapToNClustersRestrictedByMap(), ContextDependency::Copy(), TableEventMap::Copy(), kaldi::DoTableSplit(), kaldi::DoTableSplitMultiple(), kaldi::MapEventMapLeaves(), kaldi::RenumberEventMap(), kaldi::ShareEventMapLeaves(), kaldi::SplitDecisionTree(), kaldi::TestClusterEventMapGetMappingAndRenumberEventMap(), kaldi::TestClusterEventMapGetMappingAndRenumberEventMap2(), and kaldi::TestEventMapPrune().
|
inline |
Definition at line 117 of file event-map.h.
References EventMap::Copy().
Referenced by EventMap::Copy().
|
pure virtual |
Implemented in SplitEventMap, TableEventMap, and ConstantEventMap.
Referenced by kaldi::GetTreeStructureInternal(), and kaldi::IsLeafNode().
|
static |
Definition at line 290 of file event-map.cc.
References EventMap::Check().
Referenced by DecisionTreeSplitter::DoSplitInternal(), kaldi::FilterStatsByKey(), kaldi::PossibleValues(), TreeRenderer::RenderSplit(), TreeRenderer::RenderTable(), kaldi::SplitStatsByKey(), kaldi::TestDoTableSplit(), kaldi::TestGenRandStats(), and kaldi::TestSplitStatsByKey().
|
pure virtual |
Implemented in SplitEventMap, TableEventMap, and ConstantEventMap.
Referenced by ContextDependency::Compute(), kaldi::ComputeTreeMapping(), kaldi::GetTreeStructure(), kaldi::GetTreeStructureInternal(), kaldi::InitAmGmmFromOld(), kaldi::SplitStatsByMap(), kaldi::TestBuildTree(), kaldi::TestClusterEventMap(), kaldi::TestDoTableSplit(), kaldi::TestEventMapMapValues(), kaldi::TestEventMapPrune(), and kaldi::TestTrivialTree().
|
pure virtual |
Implemented in SplitEventMap, TableEventMap, and ConstantEventMap.
Referenced by TableEventMap::MapValues(), SplitEventMap::MapValues(), and kaldi::TestEventMapMapValues().
|
inlinevirtual |
Definition at line 142 of file event-map.h.
References KALDI_WARN.
Referenced by kaldi::BuildTreeTwoLevel(), kaldi::ComputeTreeMapping(), kaldi::GetOccs(), kaldi::InitAmGmm(), kaldi::InitAmGmmFromOld(), ContextDependency::NumPdfs(), kaldi::TestClusterEventMapGetMappingAndRenumberEventMap(), and kaldi::TestEventMap().
|
pure virtual |
Implemented in SplitEventMap, TableEventMap, and ConstantEventMap.
Referenced by ContextDependency::EnumeratePairs(), ContextDependency::GetPdfInfo(), kaldi::RenumberEventMap(), kaldi::ShareEventMapLeaves(), kaldi::TestClusterEventMapGetMappingAndRenumberEventMap(), kaldi::TestClusterEventMapGetMappingAndRenumberEventMap2(), kaldi::TestEventMapPrune(), and kaldi::TestShareEventMapLeaves().
|
pure virtual |
Implemented in SplitEventMap, TableEventMap, and ConstantEventMap.
Referenced by TableEventMap::Prune(), SplitEventMap::Prune(), and kaldi::TestEventMapPrune().
a Read function that reads an arbitrary EventMap; also works for NULL pointers.
Definition at line 36 of file event-map.cc.
References kaldi::CharToString(), kaldi::ExpectToken(), KALDI_ERR, kaldi::Peek(), ConstantEventMap::Read(), TableEventMap::Read(), and SplitEventMap::Read().
Referenced by ContextDependency::Read(), TableEventMap::Read(), SplitEventMap::Read(), and kaldi::TestEventMapIo().
|
pure virtual |
Write to stream.
Implemented in SplitEventMap, TableEventMap, and ConstantEventMap.
Referenced by kaldi::TestBuildTree(), kaldi::TestEventMapIo(), ContextDependency::Write(), EventMap::Write(), and TableEventMap::Write().
a Write function that takes care of NULL pointers.
Definition at line 28 of file event-map.cc.
References EventMap::Write(), and kaldi::WriteToken().