NnetDiscriminativeExampleStructureCompare Struct Reference

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

#include <nnet-discriminative-example.h>

Public Member Functions

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

Detailed Description

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

Definition at line 147 of file nnet-discriminative-example.h.

Member Function Documentation

◆ operator()() [1/2]

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

Definition at line 410 of file nnet-discriminative-example.cc.

References rnnlm::i, NnetDiscriminativeExample::inputs, and NnetDiscriminativeExample::outputs.

412  {
413  NnetIoStructureCompare io_compare;
414  if (a.inputs.size() != b.inputs.size() ||
415  a.outputs.size() != b.outputs.size())
416  return false;
417  size_t size = a.inputs.size();
418  for (size_t i = 0; i < size; i++)
419  if (!io_compare(a.inputs[i], b.inputs[i]))
420  return false;
421  size = a.outputs.size();
422  for (size_t i = 0; i < size; i++)
423  if (a.outputs[i].name != b.outputs[i].name ||
424  a.outputs[i].indexes != b.outputs[i].indexes)
425  return false;
426  return true;
427 }

◆ operator()() [2/2]


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