BackpropTruncationComponentPrecomputedIndexes Class Reference

#include <nnet-general-component.h>

Inheritance diagram for BackpropTruncationComponentPrecomputedIndexes:
Collaboration diagram for BackpropTruncationComponentPrecomputedIndexes:

Public Member Functions

 BackpropTruncationComponentPrecomputedIndexes ()
 
virtual ~BackpropTruncationComponentPrecomputedIndexes ()
 
virtual ComponentPrecomputedIndexesCopy () const
 
virtual void Write (std::ostream &ostream, bool binary) const
 
virtual void Read (std::istream &istream, bool binary)
 
virtual std::string Type () const
 
- Public Member Functions inherited from ComponentPrecomputedIndexes
virtual ~ComponentPrecomputedIndexes ()
 

Public Attributes

CuVector< BaseFloatzeroing
 
BaseFloat zeroing_sum
 

Additional Inherited Members

- Static Public Member Functions inherited from ComponentPrecomputedIndexes
static ComponentPrecomputedIndexesReadNew (std::istream &is, bool binary)
 
static ComponentPrecomputedIndexesNewComponentPrecomputedIndexesOfType (const std::string &cpi_type)
 

Detailed Description

Definition at line 569 of file nnet-general-component.h.

Constructor & Destructor Documentation

◆ BackpropTruncationComponentPrecomputedIndexes()

◆ ~BackpropTruncationComponentPrecomputedIndexes()

Definition at line 587 of file nnet-general-component.h.

587 { }

Member Function Documentation

◆ Copy()

◆ Read()

void Read ( std::istream &  istream,
bool  binary 
)
virtual

Implements ComponentPrecomputedIndexes.

Definition at line 969 of file nnet-general-component.cc.

References kaldi::ExpectOneOrTwoTokens(), kaldi::nnet3::ExpectToken(), and kaldi::ReadBasicType().

970  {
971  ExpectOneOrTwoTokens(istream, binary,
972  "<BackpropTruncationComponentPrecomputedIndexes>",
973  "<Zeroing>");
974  zeroing.Read(istream, binary);
975  ExpectToken(istream, binary, "<ZeroingSum>");
976  ReadBasicType(istream, binary, &zeroing_sum);
977  ExpectToken(istream, binary,
978  "</BackpropTruncationComponentPrecomputedIndexes>");
979 }
void ReadBasicType(std::istream &is, bool binary, T *t)
ReadBasicType is the name of the read function for bool, integer types, and floating-point types...
Definition: io-funcs-inl.h:55
void ExpectOneOrTwoTokens(std::istream &is, bool binary, const std::string &token1, const std::string &token2)
This function is like ExpectToken but for two tokens, and it will either accept token1 and then token...
Definition: text-utils.cc:536
static void ExpectToken(const std::string &token, const std::string &what_we_are_parsing, const std::string **next_token)

◆ Type()

virtual std::string Type ( ) const
inlinevirtual

Implements ComponentPrecomputedIndexes.

Definition at line 597 of file nnet-general-component.h.

597  {
598  return "BackpropTruncationComponentPrecomputedIndexes";
599  }

◆ Write()

void Write ( std::ostream &  ostream,
bool  binary 
) const
virtual

Implements ComponentPrecomputedIndexes.

Definition at line 957 of file nnet-general-component.cc.

References kaldi::WriteBasicType(), and kaldi::WriteToken().

958  {
959  WriteToken(ostream, binary,
960  "<BackpropTruncationComponentPrecomputedIndexes>");
961  WriteToken(ostream, binary, "<Zeroing>");
962  zeroing.Write(ostream, binary);
963  WriteToken(ostream, binary, "<ZeroingSum>");
964  WriteBasicType(ostream, binary, zeroing_sum);
965  WriteToken(ostream, binary,
966  "</BackpropTruncationComponentPrecomputedIndexes>");
967 }
void WriteToken(std::ostream &os, bool binary, const char *token)
The WriteToken functions are for writing nonempty sequences of non-space characters.
Definition: io-funcs.cc:134
void WriteBasicType(std::ostream &os, bool binary, T t)
WriteBasicType is the name of the write function for bool, integer types, and floating-point types...
Definition: io-funcs-inl.h:34

Member Data Documentation

◆ zeroing

◆ zeroing_sum


The documentation for this class was generated from the following files: