1 #ifndef DYSCO_WEIGHT_ENCODER_H
2 #define DYSCO_WEIGHT_ENCODER_H
38 const std::vector<value_t> &input)
const {
40 typename std::vector<value_t>::const_iterator i = input.begin();
43 while (i != input.end()) {
44 if (*i > scaleVal) scaleVal = *i;
49 typename std::vector<symbol_t>::iterator d = dest.begin();
51 while (i != input.end()) {
52 *d = roundf(scaleFact * (*i));
67 const std::vector<symbol_t> &input)
const {
68 typename std::vector<symbol_t>::const_iterator i = input.begin();
69 typename std::vector<value_t>::iterator d = dest.begin();
71 while (i != input.end()) {
72 *d = (*i) * scaleFact;
unsigned symbol_t
Value type of the symbols to which the weights are encoded.
Encoder for visibility weights.
void Encode(value_t &scaleVal, std::vector< symbol_t > &dest, const std::vector< value_t > &input) const
Encodes a vector of values.
void Decode(std::vector< value_t > &dest, value_t scaleVal, const std::vector< symbol_t > &input) const
Decode a previously encoded value.
WeightEncoder(unsigned quantCount)
Construct a new encoder with the given quantization count.
T value_t
Value type of the original weights (a floating point value).