21 #ifndef KALDI_TREE_CLUSTERABLE_CLASSES_H_ 22 #define KALDI_TREE_CLUSTERABLE_CLASSES_H_ 1 38 virtual std::string
Type()
const {
return "scalar"; }
49 virtual void Write(std::ostream &os,
bool binary)
const;
59 void Read(std::istream &is,
bool binary);
69 count_(0.0), stats_(2, dim), var_floor_(var_floor) {}
75 virtual std::string
Type()
const {
return "gauss"; }
84 virtual void Write(std::ostream &os,
bool binary)
const;
97 void Read(std::istream &is,
bool binary);
110 count_(count), stats_(2, x_stats.Dim()), var_floor_(var_floor) {
128 virtual std::string
Type()
const {
return "vector"; }
137 virtual void Write(std::ostream &os,
bool binary)
const;
147 void Read(std::istream &is,
bool binary);
154 #endif // KALDI_TREE_CLUSTERABLE_CLASSES_H_ This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
virtual void SetZero()
Set stats to empty.
virtual void Write(std::ostream &os, bool binary) const
Write data to stream.
ScalarClusterable(BaseFloat x)
virtual BaseFloat Normalizer() const
Return the normalizer (typically, count) associated with the stats.
virtual void SetZero()
Set stats to empty.
virtual ~VectorClusterable()
virtual void Scale(BaseFloat f)
Scale the stats by a positive number f [not mandatory to supply this].
virtual Clusterable * ReadNew(std::istream &is, bool binary) const
Read data from a stream and return the corresponding object (const function; it's a class member beca...
VectorClusterable wraps vectors in a form accessible to generic clustering algorithms.
virtual void Add(const Clusterable &other_in)
Add other stats.
virtual Clusterable * Copy() const
Return a copy of this object.
GaussClusterable(int32 dim, BaseFloat var_floor)
virtual BaseFloat Normalizer() const
Return the normalizer (typically, count) associated with the stats.
virtual BaseFloat Normalizer() const
Return the normalizer (typically, count) associated with the stats.
const SubVector< Real > Row(MatrixIndexT i) const
Return specific row of matrix [const].
virtual std::string Type() const
Return a string that describes the inherited type.
virtual Clusterable * Copy() const
Return a copy of this object.
virtual void Add(const Clusterable &other_in)
Add other stats.
virtual Clusterable * ReadNew(std::istream &is, bool binary) const
Read data from a stream and return the corresponding object (const function; it's a class member beca...
virtual BaseFloat Objf() const
Return the objective function associated with the stats [assuming ML estimation]. ...
virtual void Scale(BaseFloat f)
Scale the stats by a positive number f [not mandatory to supply this].
virtual void Write(std::ostream &os, bool binary) const
Write data to stream.
virtual ~GaussClusterable()
A class representing a vector.
virtual void SetZero()
Set stats to empty.
SubVector< double > x2_stats() const
virtual BaseFloat Objf() const
Return the objective function associated with the stats [assuming ML estimation]. ...
virtual std::string Type() const
Return a string that describes the inherited type.
virtual void Sub(const Clusterable &other_in)
Subtract other stats.
void Read(std::istream &is, bool binary)
virtual std::string Type() const
Return a string that describes the inherited type.
Provides a vector abstraction class.
GaussClusterable wraps Gaussian statistics in a form accessible to generic clustering algorithms...
SubVector< double > x_stats() const
Represents a non-allocating general vector which can be defined as a sub-vector of higher-level vecto...
void Read(std::istream &is, bool binary)
void Set(Real)
Sets all elements to a specific value.
virtual void Sub(const Clusterable &other_in)
Subtract other stats.
ScalarClusterable clusters scalars with x^2 loss.