All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BackpropTruncationComponentPrecomputedIndexes Class Reference

#include <nnet-general-component.h>

Inheritance diagram for BackpropTruncationComponentPrecomputedIndexes:
Collaboration diagram for BackpropTruncationComponentPrecomputedIndexes:

Public Member Functions

 BackpropTruncationComponentPrecomputedIndexes ()
virtual ~BackpropTruncationComponentPrecomputedIndexes ()
Copy () 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
ReadNew (std::istream &is, bool binary)
NewComponentPrecomputedIndexesOfType (const std::string &cpi_type)

Detailed Description

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

Constructor & Destructor Documentation

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

574 { }

Member Function Documentation

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

Implements ComponentPrecomputedIndexes.

Definition at line 962 of file

References kaldi::nnet3::ExpectOneOrTwoTokens(), kaldi::nnet3::ExpectToken(), CuVector< Real >::Read(), kaldi::ReadBasicType(), BackpropTruncationComponentPrecomputedIndexes::zeroing, and BackpropTruncationComponentPrecomputedIndexes::zeroing_sum.

963  {
964  ExpectOneOrTwoTokens(istream, binary,
965  "<BackpropTruncationComponentPrecomputedIndexes>",
966  "<Zeroing>");
967  zeroing.Read(istream, binary);
968  ExpectToken(istream, binary, "<ZeroingSum>");
969  ReadBasicType(istream, binary, &zeroing_sum);
970  ExpectToken(istream, binary,
971  "</BackpropTruncationComponentPrecomputedIndexes>");
972 }
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 Read(std::istream &is, bool binary)
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...
static void ExpectToken(const std::string &token, const std::string &what_we_are_parsing, const std::string **next_token)
virtual std::string Type ( ) const

Implements ComponentPrecomputedIndexes.

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

584  {
585  return "BackpropTruncationComponentPrecomputedIndexes";
586  }
void Write ( std::ostream &  ostream,
bool  binary 
) const

Implements ComponentPrecomputedIndexes.

Definition at line 950 of file

References CuVector< Real >::Write(), kaldi::WriteBasicType(), kaldi::WriteToken(), BackpropTruncationComponentPrecomputedIndexes::zeroing, and BackpropTruncationComponentPrecomputedIndexes::zeroing_sum.

951  {
952  WriteToken(ostream, binary,
953  "<BackpropTruncationComponentPrecomputedIndexes>");
954  WriteToken(ostream, binary, "<Zeroing>");
955  zeroing.Write(ostream, binary);
956  WriteToken(ostream, binary, "<ZeroingSum>");
957  WriteBasicType(ostream, binary, zeroing_sum);
958  WriteToken(ostream, binary,
959  "</BackpropTruncationComponentPrecomputedIndexes>");
960 }
void Write(std::ostream &is, bool binary) const
void WriteToken(std::ostream &os, bool binary, const char *token)
The WriteToken functions are for writing nonempty sequences of non-space characters.
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

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