[][src]Function deep_learning_playground::perceptron::single::or_perceptron

pub fn or_perceptron() -> Box<dyn Fn(bool, bool) -> bool>

or_perceptron generates the logical OR function. Let \(p\) and \(q\) are logical variables, or_perceptron()(\(p\),\(q\)) generates the function which satisfies the following truth table.

\(p\)\(q\)or_perceptron()(\(p\),\(q\))
\(1\)\(1\)\(1\)
\(1\)\(0\)\(1\)
\(0\)\(1\)\(1\)
\(0\)\(0\)\(0\)

e.g.

assert_eq!(true, deep_learning_playground::perceptron::single::or_perceptron()(true, false));
assert_eq!(false, deep_learning_playground::perceptron::single::or_perceptron()(false, false));