111 bool last_was_identity_ =
true;
112 bool has_forwarded_ =
false;
Vendor-agnostic compute/memory backend. CPUBackend, CUDABackend (Phase 1.5), and HIPBackend (Phase 1....
Definition device_backend.hpp:219
virtual DeviceType device() const noexcept=0
Which device this backend's buffers reside on.
y = (mask_i ? x_i / (1 - p) : 0) at training time (inverted dropout – scaling happens at training tim...
Definition dropout_module.hpp:30
Tensor forward_impl(const Tensor &input) override
The actual forward computation – per-element RNG draw at training time, identity at eval time or p ==...
Tensor backward(const Tensor &grad_output) override
Computes the gradient w.r.t. this module's input: grad_output * mask * scale, the true gradient of th...
DropoutModule(float p, DeviceBackend *backend, uint64_t seed)
Constructs a dropout layer.
bool supports_lrp_rule(LRPRule) const override
Pass-through relevance is the same under every rule: supports all of them.
Definition dropout_module.hpp:89
DropoutModule(float p, DeviceBackend *backend)
Seeded from the global seed stream (next_seed(), FND-7), so every layer built this way draws its own ...
Tensor propagate_relevance(const Tensor &relevance_out, const LRPRuleConfig &config) override
Unconditional identity LRP relevance propagation.
std::optional< DeviceType > compute_device() const override
Where this layer computes, so forward() rejects an input on another device (FND-8).
Definition dropout_module.hpp:93
OpType op_type() const override
Elementwise per charter's closed OpType set – a per-element scale-or-zero operation,...
Definition dropout_module.hpp:73
Base class for every layer type (LinearModule, Conv2DModule, activations, ...).
Definition module.hpp:58
An N-dimensional shape. A plain aggregate of dimensions with no invariant beyond "non-negative dimens...
Definition shape.hpp:24
N-dimensional tensor. Owns its data buffer exclusively; a DeviceBackend* is injected (not owned) – th...
Definition tensor.hpp:29
Abstract base every layer subclasses – NVI forward(), pure-virtual LRP contract.
Definition acquisition_functions.hpp:16
OpType
The op-type tag a Node carries. Charter Part 2 §3: nodes are tagged by a small closed set of op types...
Definition op_type.hpp:19
LRPRule
The LRP rule family a module applies. Semantics follow Zennit 1.0.0 exactly (Anders et al....
Definition lrp_rule_config.hpp:19
Configuration for LRP relevance propagation: which rule a module applies and its hyperparameters....
Definition lrp_rule_config.hpp:57