pulsatrix
Loading...
Searching...
No Matches
satisfaction_loss.hpp
Go to the documentation of this file.
1
6#pragma once
7
10#include "pulsatrix/tensor.hpp"
11
12namespace pulsatrix {
13
50public:
58 explicit SatisfactionLoss(DeviceBackend* backend, float p = 2.0f);
59
74 [[nodiscard]] float forward(const Tensor& truth_values);
75
88 [[nodiscard]] Tensor backward();
89
90private:
91 DeviceBackend* backend_;
92 AggregatorModule aggregator_;
93 bool has_forwarded_ = false;
94};
95
96} // namespace pulsatrix
Differentiable p-mean quantifier aggregator – Phase 1 Mission 1 of campaign_exai_dl_library_neuro_sym...
y = (mean(x^p))^(1/p), reduced over the leading (batch/grounding) axis – not the last axis....
Definition aggregator_module.hpp:56
Vendor-agnostic compute/memory backend. CPUBackend, CUDABackend (Phase 1.5), and HIPBackend (Phase 1....
Definition device_backend.hpp:219
loss = 1 - agg_p(truth_values) – the standard LTN "Real Logic" training objective (research_2026_neur...
Definition satisfaction_loss.hpp:49
Tensor backward()
Gradient w.r.t. truth_values: d(loss)/d(sat) == -1 exactly (the complement is affine),...
SatisfactionLoss(DeviceBackend *backend, float p=2.0f)
Constructs a satisfaction loss with an internally-owned p-mean aggregator.
float forward(const Tensor &truth_values)
Aggregates truth_values into a single scalar satisfaction degree and returns 1 - that.
N-dimensional tensor. Owns its data buffer exclusively; a DeviceBackend* is injected (not owned) – th...
Definition tensor.hpp:29
Abstract interface isolating vendor-specific memory/compute operations from Tensor/ComputationGraph.
Definition acquisition_functions.hpp:16
N-dimensional tensor – owns a buffer via DeviceBackend*, RAII (Rule of Five).