NnetIoStructureHasher Struct Reference

This hashing object hashes just the structural aspects of the NnetIo object (name, indexes, feature dimension) without looking at the value of features. More...

#include <nnet-example.h>

Public Member Functions

size_t operator() (const NnetIo &a) const noexcept
 

Detailed Description

This hashing object hashes just the structural aspects of the NnetIo object (name, indexes, feature dimension) without looking at the value of features.

It will be used in combining egs into batches of all similar structure.

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

Member Function Documentation

◆ operator()()

size_t operator() ( const NnetIo a) const
noexcept

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

140  {
141  StringHasher string_hasher;
142  IndexVectorHasher indexes_hasher;
143 
144  // numbers appearing here were taken at random from a list of primes.
145  size_t ans = string_hasher(io.name) +
146  indexes_hasher(io.indexes) +
147  19249 * io.features.NumRows() +
148  14731 * io.features.NumCols();
149  return ans;
150 }

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