Kaspersky Neuromorphic Platform  1.0.0
API Reference
Loading...
Searching...
No Matches
input_interpreters.h
Go to the documentation of this file.
1
21#pragma once
22
23
28{
35template <class ValueType>
36bool interpret_as_bool(ValueType val)
37{
38 return val;
39}
40
41
48template <class ValueType>
49auto interpret_with_threshold(ValueType threshold)
50{
51 // We're using !(a < b) instead of (a >= b) because of the values which only have operator "less than".
52 return [threshold](ValueType val) -> bool { return !(val < threshold); };
53}
54
55} // namespace knp::framework::io::input
Input channel namespace.
auto interpret_with_threshold(ValueType threshold)
Interpret an input value as a spike if an input value is equal or greater than a threshold value.
bool interpret_as_bool(ValueType val)
Determine if an input value is a spike and convert an input value to boolean.