return hashValue;
}
- static IndexType get_weight_index_scrambled(IndexType i)
+ static constexpr IndexType get_weight_index_scrambled(IndexType i)
{
return
(i / 4) % (PaddedInputDimensions / 4) * OutputDimensions * 4 +
i % 4;
}
- static IndexType get_weight_index(IndexType i)
+ static constexpr IndexType get_weight_index(IndexType i)
{
#if defined (USE_SSSE3)
return get_weight_index_scrambled(i);
return !stream.fail();
}
// Forward propagation
- const OutputType* propagate(
+ void propagate(
const InputType* input, OutputType* output) const {
#if defined (USE_AVX512)
PaddedInputDimensions,
OutputDimensions>(output, weights, biases, input);
#endif
-
- return output;
}
private:
template <IndexType InDims, IndexType OutDims>
class AffineTransformSparseInput {
public:
- // Input/output type
// Input/output type
using InputType = std::uint8_t;
using OutputType = std::int32_t;
return hashValue;
}
- static IndexType get_weight_index_scrambled(IndexType i)
+ static constexpr IndexType get_weight_index_scrambled(IndexType i)
{
return
(i / ChunkSize) % (PaddedInputDimensions / ChunkSize) * OutputDimensions * ChunkSize +
i % ChunkSize;
}
- static IndexType get_weight_index(IndexType i)
+ static constexpr IndexType get_weight_index(IndexType i)
{
#if defined (USE_SSSE3)
return get_weight_index_scrambled(i);
return !stream.fail();
}
// Forward propagation
- const OutputType* propagate(
+ void propagate(
const InputType* input, OutputType* output) const {
#if defined (USE_SSSE3)
PaddedInputDimensions,
OutputDimensions>(output, weights, biases, input);
#endif
-
- return output;
}
private:
}
// Forward propagation
- const OutputType* propagate(
+ void propagate(
const InputType* input, OutputType* output) const {
#if defined(USE_AVX2)
output[i] = static_cast<OutputType>(
std::max(0, std::min(127, input[i] >> WeightScaleBits)));
}
-
- return output;
}
};
}
// Forward propagation
- const OutputType* propagate(
+ void propagate(
const InputType* input, OutputType* output) const {
#if defined(USE_SSE2)
// needs to be accounted for in the trainer
std::max(0ll, std::min(127ll, (((long long)input[i] * input[i]) >> (2 * WeightScaleBits)) / 128)));
}
-
- return output;
}
};