pub struct NeuralPredDecl {
pub network: String,
pub inputs: Vec<String>,
pub output: String,
pub labels: Option<Vec<NeuralLabel>>,
pub predicate: Atom,
}Expand description
Neural predicate declaration
Neural predicates connect neural networks to probabilistic logic.
Syntax: nn(network, [inputs], output, [labels]) :: pred(args).
The neural network produces probability distributions over labels, which become probabilistic facts in the logic program.
§Examples
nn(mnist_net, [X], Y, [0,1,2,3,4,5,6,7,8,9]) :: digit(X, Y).
nn(encoder, [Text], Embedding) :: encode(Text, Embedding).Fields§
§network: StringName of the registered neural network
inputs: Vec<String>Input variable names (bind to tensor sources)
output: StringOutput variable name
labels: Option<Vec<NeuralLabel>>Optional classification labels (for classification networks) If None, the network produces embeddings
predicate: AtomThe predicate this neural network defines
Trait Implementations§
Source§impl Clone for NeuralPredDecl
impl Clone for NeuralPredDecl
Source§fn clone(&self) -> NeuralPredDecl
fn clone(&self) -> NeuralPredDecl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NeuralPredDecl
impl Debug for NeuralPredDecl
Source§impl PartialEq for NeuralPredDecl
impl PartialEq for NeuralPredDecl
Source§fn eq(&self, other: &NeuralPredDecl) -> bool
fn eq(&self, other: &NeuralPredDecl) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for NeuralPredDecl
Auto Trait Implementations§
impl Freeze for NeuralPredDecl
impl RefUnwindSafe for NeuralPredDecl
impl Send for NeuralPredDecl
impl Sync for NeuralPredDecl
impl Unpin for NeuralPredDecl
impl UnsafeUnpin for NeuralPredDecl
impl UnwindSafe for NeuralPredDecl
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more