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
27
namespace
knp::framework::io::input
28
{
35
template
<
class
ValueType>
36
bool
interpret_as_bool
(ValueType val)
37
{
38
return
val;
39
}
40
41
48
template
<
class
ValueType>
49
auto
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
knp::framework::io::input
Input channel namespace.
Definition
index_converter.h:43
knp::framework::io::input::interpret_with_threshold
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.
Definition
input_interpreters.h:49
knp::framework::io::input::interpret_as_bool
bool interpret_as_bool(ValueType val)
Determine if an input value is a spike and convert an input value to boolean.
Definition
input_interpreters.h:36