140 bool has_forwarded_ =
false;
Vendor-agnostic compute/memory backend. CPUBackend, CUDABackend (Phase 1.5), and HIPBackend (Phase 1....
Definition device_backend.hpp:219
y = a S b for a selected t-conorm S, over two independent fuzzy-truth-valued operand tensors (values ...
Definition disjunction_module.hpp:22
y = x @ W + b, batched (x is (N, in_features), y is (N, out_features)) – migrated from the original u...
Definition linear_module.hpp:37
y = 1 - x, elementwise. No parameters, no parameter gradients.
Definition negation_module.hpp:21
param -= learning_rate * grad, per parameter, for every parameter a Module exposes.
Definition sgd_optimizer.hpp:12
loss = 1 - agg_p(truth_values) – the standard LTN "Real Logic" training objective (research_2026_neur...
Definition satisfaction_loss.hpp:49
N-dimensional tensor. Owns its data buffer exclusively; a DeviceBackend* is injected (not owned) – th...
Definition tensor.hpp:29
A small, hand-traceable knowledge base: two neural predicates A(x)/B(x) (each a sigmoid-squashed Line...
Definition neuro_symbolic_toy_kb.hpp:55
LinearModule & predicate_b()
Predicate B's own LinearModule – test/inspection accessor.
Definition neuro_symbolic_toy_kb.hpp:113
const Tensor & last_a() const
Cached predicate A output from the most recent forward(), shape (N, 1).
Definition neuro_symbolic_toy_kb.hpp:101
ToyKnowledgeBase(DeviceBackend *backend, float p=2.0f)
Constructs the toy KB with fixed, small, sign-varied initial predicate weights (mission file Stage 3'...
NegationModule & negation_a()
Predicate A's own NegationModule (not(A)) – test/inspection accessor, added for Phase 2 Mission 0's e...
Definition neuro_symbolic_toy_kb.hpp:119
float forward(const Tensor &x)
Runs the full forward pass: A(x)/B(x) (Linear+sigmoid) -> not(A)/not(B) (NegationModule) -> rule = no...
LinearModule & predicate_a()
Predicate A's own LinearModule – test/inspection accessor.
Definition neuro_symbolic_toy_kb.hpp:110
const Tensor & last_b() const
Cached predicate B output from the most recent forward(), shape (N, 1).
Definition neuro_symbolic_toy_kb.hpp:104
const Tensor & last_rule() const
Cached rule truth degrees from the most recent forward(), shape (N,).
Definition neuro_symbolic_toy_kb.hpp:107
DisjunctionModule & disjunction()
The rule's own DisjunctionModule (not(A) or not(B), Product) – test/inspection accessor,...
Definition neuro_symbolic_toy_kb.hpp:127
float train_step(const Tensor &x, SGDOptimizer &optimizer)
One SGD step: zero_grad both predicates, forward(), backward(), optimizer step on both predicates.
void backward()
Backpropagates the loss through SatisfactionLoss -> DisjunctionModule -> NegationModule(x2) -> sigmoi...
NegationModule & negation_b()
Predicate B's own NegationModule (not(B)) – test/inspection accessor, same rationale as negation_a().
Definition neuro_symbolic_toy_kb.hpp:123
Abstract interface isolating vendor-specific memory/compute operations from Tensor/ComputationGraph.
Differentiable fuzzy disjunction (t-conorm) – Phase 1 Mission 0 of campaign_exai_dl_library_neuro_sym...
Dense/fully-connected layer – the reference Module implementation.
Definition acquisition_functions.hpp:16
Standard fuzzy negation y = 1 - x – Phase 1 Mission 0 of campaign_exai_dl_library_neuro_symbolic (dif...
Real-Logic-style knowledge-base satisfaction loss – Phase 1 Mission 1 of campaign_exai_dl_library_neu...
Stochastic gradient descent – operates uniformly across any Module's parameters().
N-dimensional tensor – owns a buffer via DeviceBackend*, RAII (Rule of Five).