#include <clusterable-itf.h>
Public Member Functions | |
Functions that must be overridden | |
virtual Clusterable * | Copy () const =0 |
Return a copy of this object. More... | |
virtual BaseFloat | Objf () const =0 |
Return the objective function associated with the stats [assuming ML estimation]. More... | |
virtual BaseFloat | Normalizer () const =0 |
Return the normalizer (typically, count) associated with the stats. More... | |
virtual void | SetZero ()=0 |
Set stats to empty. More... | |
virtual void | Add (const Clusterable &other)=0 |
Add other stats. More... | |
virtual void | Sub (const Clusterable &other)=0 |
Subtract other stats. More... | |
virtual void | Scale (BaseFloat f) |
Scale the stats by a positive number f [not mandatory to supply this]. More... | |
virtual std::string | Type () const =0 |
Return a string that describes the inherited type. More... | |
virtual void | Write (std::ostream &os, bool binary) const =0 |
Write data to stream. More... | |
virtual Clusterable * | ReadNew (std::istream &os, bool binary) const =0 |
Read data from a stream and return the corresponding object (const function; it's a class member because we need access to the vtable so generic code can read derived types). More... | |
virtual | ~Clusterable () |
Functions that have default implementations | |
virtual BaseFloat | ObjfPlus (const Clusterable &other) const |
Return the objective function of the combined object this + other. More... | |
virtual BaseFloat | ObjfMinus (const Clusterable &other) const |
Return the objective function of the subtracted object this - other. More... | |
virtual BaseFloat | Distance (const Clusterable &other) const |
Return the objective function decrease from merging the two clusters, negated to be a positive number (or zero). More... | |
Definition at line 38 of file clusterable-itf.h.
|
inlinevirtual |
Definition at line 72 of file clusterable-itf.h.
References Clusterable::Distance(), Clusterable::ObjfMinus(), and Clusterable::ObjfPlus().
|
pure virtual |
Add other stats.
Implemented in VectorClusterable, GaussClusterable, and ScalarClusterable.
Referenced by kaldi::AddToClustersOptimized(), Clusterable::Distance(), RefineClusterer::InitPoint(), main(), Clusterable::ObjfPlus(), kaldi::SumClusterable(), kaldi::SumStats(), kaldi::TestClusterUtils(), kaldi::TestClusterUtilsVector(), kaldi::TestContextDep(), and RefineClusterer::UpdateInfo().
|
pure virtual |
Return a copy of this object.
Implemented in VectorClusterable, GaussClusterable, and ScalarClusterable.
Referenced by kaldi::AddToClustersOptimized(), Clusterable::Distance(), kaldi::EnsureClusterableVectorNotNull(), RefineClusterer::InitPoint(), Clusterable::ObjfMinus(), Clusterable::ObjfPlus(), kaldi::SumClusterable(), kaldi::SumStats(), kaldi::TestClusterUtils(), kaldi::TestClusterUtilsVector(), kaldi::TestContextDep(), and RefineClusterer::UpdateInfo().
|
virtual |
Return the objective function decrease from merging the two clusters, negated to be a positive number (or zero).
Definition at line 49 of file clusterable-classes.cc.
References Clusterable::Add(), Clusterable::Copy(), KALDI_WARN, and Clusterable::Objf().
Referenced by DecisionTreeSplitter::DoSplitInternal(), and Clusterable::~Clusterable().
|
pure virtual |
Return the normalizer (typically, count) associated with the stats.
Implemented in VectorClusterable, GaussClusterable, and ScalarClusterable.
Referenced by kaldi::AddToClustersOptimized(), kaldi::SumNormalizer(), kaldi::TestClusterUtils(), kaldi::TestClusterUtilsVector(), and kaldi::TestContextDep().
|
pure virtual |
Return the objective function associated with the stats [assuming ML estimation].
Implemented in VectorClusterable, GaussClusterable, and ScalarClusterable.
Referenced by kaldi::ClusterKMeansOnce(), kaldi::ComputeInitialSplit(), Clusterable::Distance(), Clusterable::ObjfMinus(), Clusterable::ObjfPlus(), kaldi::SumObjf(), kaldi::TestClusterUtils(), kaldi::TestClusterUtilsVector(), kaldi::TestContextDep(), kaldi::TestSum(), and RefineClusterer::UpdateInfo().
|
virtual |
Return the objective function of the subtracted object this - other.
Definition at line 41 of file clusterable-classes.cc.
References Clusterable::Copy(), Clusterable::Objf(), and Clusterable::Sub().
Referenced by Clusterable::~Clusterable().
|
virtual |
Return the objective function of the combined object this + other.
Definition at line 33 of file clusterable-classes.cc.
References Clusterable::Add(), Clusterable::Copy(), and Clusterable::Objf().
Referenced by Clusterable::~Clusterable().
|
pure virtual |
Read data from a stream and return the corresponding object (const function; it's a class member because we need access to the vtable so generic code can read derived types).
Implemented in VectorClusterable, GaussClusterable, and ScalarClusterable.
Referenced by kaldi::ReadBuildTreeStats(), and Clusterable::Scale().
|
inlinevirtual |
Scale the stats by a positive number f [not mandatory to supply this].
Reimplemented in VectorClusterable, and GaussClusterable.
Definition at line 57 of file clusterable-itf.h.
References KALDI_ERR, Clusterable::ReadNew(), Clusterable::Type(), and Clusterable::Write().
Referenced by GaussClusterable::Normalizer().
|
pure virtual |
Set stats to empty.
Implemented in VectorClusterable, GaussClusterable, and ScalarClusterable.
Referenced by kaldi::EnsureClusterableVectorNotNull().
|
pure virtual |
Subtract other stats.
Implemented in VectorClusterable, GaussClusterable, and ScalarClusterable.
Referenced by Clusterable::ObjfMinus(), and RefineClusterer::UpdateInfo().
|
pure virtual |
Return a string that describes the inherited type.
Implemented in VectorClusterable, GaussClusterable, and ScalarClusterable.
Referenced by ScalarClusterable::Add(), GaussClusterable::Add(), VectorClusterable::Add(), Clusterable::Scale(), ScalarClusterable::Sub(), GaussClusterable::Sub(), and VectorClusterable::Sub().
|
pure virtual |
Write data to stream.
Implemented in VectorClusterable, GaussClusterable, and ScalarClusterable.
Referenced by Clusterable::Scale().