NnetExampleStructureCompare Struct Reference

This comparator object compares just the structural aspects of the NnetExample without looking at the value of the features. More...

#include <nnet-example.h>

Public Member Functions

bool operator() (const NnetExample &a, const NnetExample &b) const
 
bool operator() (const NnetExample *a, const NnetExample *b) const
 

Detailed Description

This comparator object compares just the structural aspects of the NnetExample without looking at the value of the features.

Like NnetExampleStructureHasher, it is sensitive to the order in which the differently-named NnetIo elements appear. This hashing object will be used in combining egs into batches of all similar structure.

Definition at line 159 of file nnet-example.h.

Member Function Documentation

◆ operator()() [1/2]

bool operator() ( const NnetExample a,
const NnetExample b 
) const

Definition at line 172 of file nnet-example.cc.

References rnnlm::i, and NnetExample::io.

173  {
174  NnetIoStructureCompare io_compare;
175  if (a.io.size() != b.io.size())
176  return false;
177  size_t size = a.io.size();
178  for (size_t i = 0; i < size; i++)
179  if (!io_compare(a.io[i], b.io[i]))
180  return false;
181  return true;
182 }

◆ operator()() [2/2]

bool operator() ( const NnetExample a,
const NnetExample b 
) const
inline

Definition at line 163 of file nnet-example.h.

164  { return (*this)(*a, *b); }

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