|
| class | ActivationSnapshot |
| | A copyable, self-contained record of every activation cached during one forward pass, plus the node ids in topological order and each node's op_type/label metadata. More...
|
| |
| class | AdamOptimizer |
| | Adam (Kingma & Ba, 2015): per-parameter moving averages of gradient (m) and squared gradient (v), with bias correction. More...
|
| |
| class | Agent |
| | Base class for anything that maps an observation to an action. More...
|
| |
| class | AggregatorModule |
| | y = (mean(x^p))^(1/p), reduced over the leading (batch/grounding) axis – not the last axis. Rank-agnostic: input shape (N, ...rest) reduces to output shape (...rest) (rank 0 – a scalar – when input is rank 1, i.e. a single formula's groundings with no other axes). More...
|
| |
| struct | ASHAResult |
| | The best configuration/metric found, the total epoch budget spent, and how many distinct configurations were ever started (as opposed to promoted). More...
|
| |
| struct | Attribution |
| | An explanation result: the raw attribution values, the method that produced them, and any relevant metadata (charter Part 2 SS4). More...
|
| |
| class | AttributionBarChart |
| | Draws a horizontal bar chart of an Attribution's top-k features (hc_information_visualization.md SS1/SS5: position-on-shared-axis is the most accurately perceived encoding for magnitude – Cleveland-McGill rank 1 – and horizontal bars read naturally with long feature names). Bar length encodes magnitude; hue (DivergingColormap) encodes sign, never magnitude. Bars start at zero (Tufte lie-factor = 1). More...
|
| |
| class | AttributionBeeswarmView |
| | Draws a beeswarm plot for one feature's attribution values across many samples/predictions – the global "how does the model behave overall" view (hc_information_visualization.md SS5), complementing AttributionBarChart's single-prediction "why this one" view. More...
|
| |
| class | AttributionWaterfallChart |
| | Draws a waterfall chart cascading from baseline_value to the final prediction (hc_information_visualization.md SS5: "correct for local explanation with
directional attribution... bars cascade from base rate to prediction; color
encodes direction; length encodes magnitude"). This is the one bar chart in this module that legitimately does not start at zero – Tufte's lie-factor rule is satisfied relative to baseline_value, the meaningful reference point, not zero. More...
|
| |
| class | AudioFolderDataset |
| | Dataset over a directory tree of the form root_dir/<class_name>/<audio_file.wav>, structurally identical to ImageFolderDataset (Phase 2): sorted subdirectory names are classes, sorted filenames within each are samples, decoded lazily per get() via WavReader. More...
|
| |
| class | Autograd |
| | Computes gradients by walking a ComputationGraph in reverse topological order. More...
|
| |
| class | AvgPool2DModule |
| | Average pooling, rank-4 (N, channels, H, W), matching Conv2DModule's convention. Stride fixed equal to kernel size (non-overlapping windows), no padding, no dilation – same minimal-cut discipline as MaxPool2DModule/Conv2DModule. More...
|
| |
| struct | BarSeries |
| | One feature-importance bar: a label and a signed value (sign carries direction). More...
|
| |
| struct | Batch |
| | One collated batch: one stacked Tensor per Sample field position. More...
|
| |
| class | BatchNormFold |
| | While alive, merges bn's affine map into conv's weights and makes bn an exact identity; on destruction, restores both bit for bit. More...
|
| |
| class | BatchNormModule |
| | y_{n,c,h,w} = gamma_c * (x_{n,c,h,w} - mu_c)/std_c + beta_c, mu_c/std_c computed per channel c over every (n, h, w) element jointly – BatchNorm's defining statistic, and the reason this module didn't exist before campaign_exai_dl_library_batch_dimension_support: it has nothing to compute over without a real batch dimension. Input/output are rank-4 (N, channels, H, W), the same convention Conv2DModule/GroupNormModule already establish. More...
|
| |
| class | BCEWithLogitsLoss |
| | loss = mean( max(x,0) - x*y + log(1 + exp(-|x|)) ), over all N*k elements of a (N, k) logit tensor x against a target tensor y of the same shape. More...
|
| |
| struct | BeeswarmPoint |
| | One beeswarm point: the attribution value (x) and a collision-avoidance vertical offset (y). More...
|
| |
| class | BoundedQueue |
| | Fixed-capacity thread-safe queue with blocking push/pop – the bounded buffer between pulsatrix data-pipeline stages (campaign_exai_dl_library_data_pipeline). Not tied to any Dataset/DataLoader type; deliberately generic. More...
|
| |
| class | CalibrationLoss |
| | BS = mean_n( Σ_k (p[n,k] − y[n,k])² ), y one-hot at target_class[n] – Brier's original multi-class proper scoring rule. More...
|
| |
| class | CartPoleEnv |
| | The classic cart-pole balancing task (Barto, Sutton & Anderson 1983), the same equations OpenAI Gym's own CartPoleEnv implements – cited as the canonical, independently-verifiable reference for this class's correctness tests, not reused as a code or runtime dependency. More...
|
| |
| class | CategoricalPolicyAgent |
| | Samples an action from softmax(policy_network(observation)) – the discrete-action stochastic policy every policy-gradient method in this phase (REINFORCE, A2C, PPO) is built on. More...
|
| |
| class | CenterCropTransform |
| | Crops the centered (crop_height, crop_width) region of the image. More...
|
| |
| struct | CircuitEdge |
| | One directed edge of a CircuitGraph, carrying a scalar weight. More...
|
| |
| class | CircuitGraph |
| | A copyable, self-contained circuit graph: every node of one forward pass with an ablation importance score, plus the weighted edges between them. More...
|
| |
| class | CircuitGraphView |
| | Draws a CircuitGraph as a node-link diagram: node position is topological depth (x-axis), node size and color encode ablation_effect via length/area AND Viridis (unsigned magnitude – never hue-for-magnitude, hc_information_visualization.md SS1), edge thickness encodes weight. Each node is captioned with CircuitNodeDisplayLabel (its own label, else op type + id) above and its ablation effect below. More...
|
| |
| struct | CircuitNode |
| | One node of a CircuitGraph: a computation-graph node plus its importance score. More...
|
| |
| class | CMAES |
| | RNG-driven ask-tell wrapper: caches the z-samples an Ask() call draws so a matching Tell() call can reuse them without the caller needing to track them. More...
|
| |
| struct | CMAESState |
| | This algorithm's full adaptive state: the search mean, the global step size, and each dimension's own variance (the diagonal of the covariance matrix). More...
|
| |
| class | Compose |
| | Eager, ordered list of Transforms applied in sequence – pulsatrix's analogue of torchvision.transforms.Compose. Deliberately simple: no fusion/graph, matching Compose's own upstream design; unlike Python, there is no GIL here for that simplicity to cost anything. More...
|
| |
| class | ComputationGraph |
| | Owns every Node in a computation graph and exposes read access for graph-walking code (autograd's backward pass, Phase 2+ explainers). More...
|
| |
| class | ConfidenceMeter |
| | Draws a filled bar whose fill length encodes confidence (position/length, never color alone – hc_information_visualization.md SS1/SS5: "confidence bar/meter...
fastest to process"). The exact percentage is always rendered as text alongside the fill – never a color-only encoding (also satisfies WCAG: a colorblind user must be able to read the value without relying on hue). More...
|
| |
| class | ConjunctionModule |
| | y = a T b for a selected t-norm T, over two independent fuzzy-truth-valued operand tensors (values intended in [0,1]; out-of-range values are not rejected – see propagate_relevance()'s note and mission_0_tnorm_operators.md's adversarial section). More...
|
| |
| struct | ConnectionGene |
| | One connection in a NEAT genome: an edge between two node IDs, its weight, whether it is currently active, and its historical marking (innovation number). Disabled connections are kept, not removed – NEAT's own design, preserving historical alignment for crossover (a future mission's concern, not built here). More...
|
| |
| struct | ConservationResult |
| | The result of comparing a relevance-propagation step's input and output totals. More...
|
| |
| class | ContinuousCartPoleEnv |
| | The cart-pole balancing task with a continuous action: the action is a single force fraction in [-1, 1] rather than a discrete left/right choice. More...
|
| |
| class | Conv2DModule |
| | 2D convolution, batched (input/output are rank-4: N x channels x H x W) – migrated from the original unbatched (rank-3) scope by campaign_exai_dl_library_batch_dimension_support. Stride 1, no padding, no dilation – deferred until a real use case needs them, same pattern as LinearModule's original unbatched scope cut. More...
|
| |
| struct | ConvGeometry |
| | Window geometry for DeviceBackend::im2col / col2im_add: kernel size, stride and zero padding per axis. Defaults are stride 1 and no padding. Passed to kernels by value. More...
|
| |
| class | CPUBackend |
| | CPU-resident DeviceBackend implementation. Reference implementation every other backend (CUDABackend, HIPBackend) is checked for numerical equivalence against. More...
|
| |
| class | CrossEntropyLoss |
| | loss = -log(softmax(logits)[target_class]), combined for numerical stability (subtract the max logit before exponentiating) rather than computing softmax and log separately. More...
|
| |
| class | CsvDataset |
| | Dataset over a CSV file's numeric columns: N named feature columns -> one (1, num_features) Tensor per row, plus one named label column -> one (1,) Tensor. Requires a header row (feature/label columns are resolved by name). More...
|
| |
| class | CsvReader |
| | Minimal RFC-4180-ish CSV parser: comma-delimited, double-quote-quoted fields, "" as an escaped quote,
or \r
line endings. Whole file loaded into memory at once – no streaming/chunked reading in this phase, matching MnistIdxLoader's own whole-file-at-once precedent. More...
|
| |
| struct | CsvTable |
| | One parsed CSV file's contents: raw string cells, row-major, plus an optional header. More...
|
| |
| class | CUDABackend |
| | CUDA-resident DeviceBackend implementation. More...
|
| |
| class | DataLoader |
| | Orchestrates sampling and collation into batches – pulsatrix's DataLoader (PyTorch DataLoader / torch::data::DataLoader analogue). More...
|
| |
| struct | DataLoaderOptions |
| | Configuration for a DataLoader. More...
|
| |
| class | Dataset |
| | Random-access dataset abstraction – pulsatrix's analogue of PyTorch's torch.utils.data.Dataset / LibTorch's torch::data::Dataset (len/__getitem__). Every concrete modality (CsvDataset, MnistDatasetAdapter, future image/text/audio readers) subclasses this; DataLoader depends only on this interface. More...
|
| |
| struct | DatasetStatistics |
| | One Dataset's per-field descriptive statistics. More...
|
| |
| class | DatasetStatisticsView |
| | Draws one histogram per Sample field (small multiples, hc_information_visualization.md SS6) plus a flagged-issue count, using DatasetValidator's existing production API (ComputeStatistics/DetectIssues) – no new core code needed, this is purely a consumer of data that already exists. More...
|
| |
| class | DatasetValidator |
| | Generic data validation over any Dataset implementation – descriptive statistics and missingness/outlier detection only (campaign_exai_dl_library_data_pipeline Decision Point 5: distributional drift detection and bias/fairness metrics are explicitly out of scope, named follow-ups for a future campaign). More...
|
| |
| class | DataThreadPool |
| | Minimal, generic thread pool for CPU-side data pipeline work (fetch, decode, transform, collate stages) – campaign_exai_dl_library_data_pipeline's staged- pipeline backbone alongside BoundedQueue. Deliberately not tied to Dataset/DataLoader types. More...
|
| |
| class | DetailedBalanceLoss |
| | ‘Δ(s,s’) = log F(s) + log P_F(s'|s) − log F(s') − log P_B(s|s'),loss = Δ(s,s')²-- the per-*transition* credit-assignment alternative toTrajectoryBalanceLoss`'s per-trajectory constraint. More...
|
| |
| class | DeviceBackend |
| | Vendor-agnostic compute/memory backend. CPUBackend, CUDABackend (Phase 1.5), and HIPBackend (Phase 1.6) all implement this contract; Tensor and ComputationGraph depend only on this interface, never on a concrete backend's types. More...
|
| |
| class | DisjunctionModule |
| | y = a S b for a selected t-conorm S, over two independent fuzzy-truth-valued operand tensors (values intended in [0,1]; out-of-range values are not rejected – see conjunction_module.hpp's identical note). More...
|
| |
| struct | DominantEigenResult |
| | PowerIteration()'s result. More...
|
| |
| class | DQNAgent |
| | The epsilon-greedy behaviour policy of Mnih et al. 2015: with probability epsilon act uniformly at random, otherwise take argmax_a Q(observation, a). More...
|
| |
| class | DQNLoss |
| | loss = mean_b( (q_values[b, a_b] - targets[b,0])^2 ), where a_b is the action actually taken on transition b – the semi-gradient TD update of Mnih et al. 2015. More...
|
| |
| class | DropoutModule |
| | y = (mask_i ? x_i / (1 - p) : 0) at training time (inverted dropout – scaling happens at training time so eval-time forward needs no rescaling); y = x at eval time or when p == 0. No parameters. More...
|
| |
| struct | EigenResult |
| | SymmetricEigen()'s result. More...
|
| |
| class | EmbeddingModule |
| | Embedding lookup table, rank-2 input (N, L) of float-encoded indices -> rank-3 output (N, L, embedding_dim). Structurally unlike every other module in this codebase: forward is a pure selection (row copy), with no arithmetic mixing across input features. More...
|
| |
| class | Environment |
| | Base class for every RL environment (CartPoleEnv, and whatever later phases add). More...
|
| |
| struct | ESResult |
| | Result of a full Evolution Strategies run. More...
|
| |
| class | ExplainerContext |
| | Wraps an ordered chain of Modules, running them via Module::forward_traced to build a real ComputationGraph and Autograd backward wiring – graph-native explainers (Missions 2-3) use graph()/backward_pass()/activation(); surrogate explainers (Phase 3) would use only forward_pass(), per the charter's stated interface segregation. More...
|
| |
| class | ExplanationScoreCard |
| | Aggregates, per prediction, a 2x2 panel: top row is "what was shown, how confident
was the model" (input label + ConfidenceMeter), bottom row is "how trustworthy is
this explanation" (LRP conservation delta + explainer stability), visually separated by a rule (Gestalt proximity grouping – these are two different semantic questions, not one undifferentiated block of numbers). More...
|
| |
| struct | FieldStatistics |
| | Descriptive statistics for one Sample field position, aggregated across a whole Dataset. More...
|
| |
| class | FlattenModule |
| | y = reshape(x, {N, x.numel()/N}), N = x.shape().dim(0). No parameters, no gradient math beyond reshaping. More...
|
| |
| struct | GAEResult |
| | ComputeGAE()'s two outputs: the advantage estimate per step and the critic's regression target per step. More...
|
| |
| class | GaussianProcessRegressor |
| | A fitted (or queryable-before-fitting-throws) Gaussian Process regressor with a squared-exponential kernel: k(x, x') = sigma_f^2 * exp(-||x - x'||^2 / (2 * length_scale^2)), plus additive observation noise (a small noise_variance is also standard GP practice purely as numerical "jitter" to keep the kernel matrix well-conditioned, independent of whether the underlying objective is actually noisy). More...
|
| |
| class | GeneratorPopulation |
| | Owns N independently-parameterized generator Modules. More...
|
| |
| class | GFlowNetForwardPolicy |
| | Samples from softmax(mask(policy_network(observation))) – a categorical policy restricted to a caller-supplied set of valid actions at the current state. More...
|
| |
| struct | GFlowNetSampledAction |
| | One sample from GFlowNetForwardPolicy::sample: the chosen action and the log-probability the masked distribution assigned to it. More...
|
| |
| struct | GFlowNetTrajectory |
| | One full sampled trajectory: every state the forward policy acted from, the action taken at each, and the trajectory-level quantities Trajectory Balance (and Detailed Balance/SubTB, in later missions) need. More...
|
| |
| struct | GpuSample |
| | One GPU's readings within a SystemSample. More...
|
| |
| class | GradCAM |
| | L^c = ReLU(sum_k alpha^c_k * A^k), where alpha^c_k = mean_ij(d(y^c)/d(A^k_ij)) and A is the last OpType::Conv node's activation. More...
|
| |
| class | GroupNormModule |
| | Splits num_channels into num_groups equal-size groups; each group's mean/std is computed over every (channel-in-group, H, W) element jointly, per batch row n, then y_{n,c,h,w} = gamma_c * (x_{n,c,h,w} - mu_{n,g})/std_{n,g} + beta_c, gamma/beta per-channel (shape (num_channels,), not per-group, not per-batch-row). Batched – input/output are rank-4 (N, channels, H, W), migrated from the original unbatched (rank-3) scope by campaign_exai_dl_library_batch_dimension_support, matching Conv2DModule's own (not-yet-migrated) rank-3 convention plus a leading batch dim. H/W are not fixed at construction (only num_groups/num_channels are), so this module accepts any spatial size at forward() time, exactly like Conv2DModule does. More...
|
| |
| class | GRUModule |
| | Standard GRU recurrence (Cho et al. 2014), h_0 = 0 (zero-initialized, not learnable – the same deliberate scope cut RNNModule/LSTMModule made, and the same thing that makes this module's conservation exact; see the LRP note below): z_t = sigmoid(x_t @ W_xz + h_{t-1} @ W_hz + b_z) (update gate), r_t = sigmoid(x_t @ W_xr + h_{t-1} @ W_hr + b_r) (reset gate), hn_prev_t = h_{t-1} @ W_hn (internal projection, no bias), n_t = tanh(x_t @ W_xn + r_t * hn_prev_t + b_n) (candidate), h_t = (1 - z_t) * h_{t-1} + z_t * n_t. Note the reset gate multiplies the projected previous hidden state hn_prev_t, not h_{t-1} itself – that projection is a distinct cached intermediate, and it is what gives GRU's LRP rule a different shape from LSTM's. Input (N, L, input_size) -> output (N, L, hidden_size), the full hidden-state sequence (matches RNNModule's/LSTMModule's convention). Single layer, no bidirectional/multi-layer/variable-length support. More...
|
| |
| struct | HeatmapColorScale |
| | The color-scale range and colormap family a heatmap's values call for. More...
|
| |
| struct | HeatmapGrid |
| | A row-major 2D grid of unsigned magnitude values, ready for a heatmap plot. More...
|
| |
| class | HIPBackend |
| | HIP-resident DeviceBackend implementation, targeting AMD GPUs via ROCm. More...
|
| |
| struct | HistogramBins |
| | Equal-width histogram bins: rows.size() == counts.size() + 1 edges. More...
|
| |
| class | HorizontalFlipTransform |
| | Mirrors the image left-right. In-place, no backend needed (same shape). More...
|
| |
| struct | HyperbandBracket |
| | One bracket's own (num_configs, initial_budget) trade-off point; s is the bracket index (s_max = most configs/smallest budget, down to s=0 = fewest configs/largest budget, matching the original paper's own naming). More...
|
| |
| struct | HyperbandResult |
| | The best configuration/metric found across every bracket, and the total epoch budget spent summed across all of them. More...
|
| |
| class | HyperGridEnv |
| | An n-dimensional grid: state is an integer coordinate in [0, H-1]^ndim, actions increment one coordinate or stop the episode, reward is concentrated near the grid's corners. More...
|
| |
| class | ImageDecoder |
| | Decodes an image file into a Tensor – pulsatrix's generalization beyond MnistIdxLoader's IDX-format-only precedent (campaign_exai_dl_library_data_pipeline, Phase 2). Powered by stb_image (public-domain, single-header, vendored via FetchContent – Decision Point 2): supports PNG/JPEG/BMP/GIF/TGA/HDR and more. More...
|
| |
| class | ImageFolderDataset |
| | Dataset over a directory tree of the form root_dir/<class_name>/<image_file>, mirroring torchvision's ImageFolder convention. Class names are the sorted subdirectory names; each class's label is its index in that sorted order. Images are decoded lazily (per get() call) via ImageDecoder. More...
|
| |
| class | ImageGridView |
| | Draws a grid of image samples from a Dataset whose first Sample field is a decoded (1,C,H,W) or (C,H,W) image tensor (e.g. ImageFolderDataset) – the data-loading "preview what you're about to train on" touchpoint. More...
|
| |
| class | ImPlotMetricsSink |
| | A concrete MetricsSink (metrics_sink.hpp's own doc comment names this the expected extension point: "Concrete writers... implement this") that buffers every logged scalar into a per-tag time series, and keeps the latest histogram snapshot per tag, for live rendering by a training dashboard. Zero core changes needed – MetricsSink* is already threaded through every training loop in this codebase (XorNetwork::train_step, MnistConvNet::train_step). More...
|
| |
| struct | Individual |
| | A single candidate solution in a genetic algorithm population. More...
|
| |
| class | InnovationTracker |
| | The global historical-marking registry: the same structural mutation (an identical new connection, or an identical connection-split creating a new node) occurring in different genomes receives the same innovation number / new node ID if it has already been recorded, and a fresh one otherwise. This is the concrete mechanism that lets two differently-shaped genomes' genes be meaningfully aligned by innovation number – NEAT's own defining idea (not built here: crossover itself is a future mission; this class only maintains the registry crossover would eventually consume). More...
|
| |
| class | IntegratedGradients |
| | IG_i(x) = (x_i - baseline_i) * (1/steps) * sum_{k=1}^{steps} d(F(baseline + (k/steps)(x - baseline)))/dx_i – a Riemann-sum approximation of the straight-line path integral from baseline to input. More...
|
| |
| class | IterableDataset |
| | Streaming dataset abstraction for sources with no random access or no known length (sharded files, generators) – pulsatrix's analogue of PyTorch's IterableDataset / tf.data's source-op model. DataLoader treats this and Dataset via a common internal adapter (data_loader.hpp) so both share one fetch/collate path. More...
|
| |
| class | KernelSHAP |
| | Approximates Shapley values via full coalition enumeration + SHAP-kernel-weighted linear regression, reusing fit_weighted_linear_regression for the reduced (n-1)-dimensional problem the efficiency-axiom substitution produces. More...
|
| |
| class | KLDivergenceLoss |
| | Closed-form KL(N(mu, sigma^2) || N(0, I)) for a diagonal Gaussian posterior (Kingma & Welling 2013, arXiv:1312.6114, Appendix B): loss = mean_b( 0.5 * sum_d( mu[b,d]^2 + exp(2*log_sigma[b,d]) - 2*log_sigma[b,d] - 1 ) ) i.e. summed over the latent dimension per example, averaged over the batch – the standard VAE ELBO normalization, matching how the reconstruction term is typically summed-per-example/averaged-over-batch too. More...
|
| |
| class | LayerNormModule |
| | y_{n,i} = gamma_i * (x_{n,i} - mu_n)/std_n + beta_i, mu_n = mean_i(x_{n,i}), std_n = sqrt(var_i(x_{n,i}) + eps), computed independently per batch row n. Batched ((N, num_features)), migrated from the original unbatched (rank-1) scope by campaign_exai_dl_library_batch_dimension_support. More...
|
| |
| class | LearnableScalar |
| | A bare learnable scalar (e.g. a GFlowNet loss's log Z), outside the Module/LRP hierarchy entirely. More...
|
| |
| class | LIME |
| | Fits a locality-weighted linear surrogate around one input: perturb x with Gaussian noise, weight each perturbed sample by an exponential locality kernel pi(z) = exp(-||z-x||^2 / (2*sigma^2)), fit w* = argmin_w sum_i pi_i*(f(z_i) - f(x) - w^T(z_i-x))^2 + l2_lambda*||w||^2 via fit_weighted_linear_regression. More...
|
| |
| class | LinearModule |
| | y = x @ W + b, batched (x is (N, in_features), y is (N, out_features)) – migrated from the original unbatched (rank-1) scope by campaign_exai_dl_library_batch_dimension_support (breaking migration to always-batched; a single example is N=1, not a structurally different case). More...
|
| |
| class | LinearProbe |
| | A linear probe: LinearModule(activation_dim, 1) + BCEWithLogitsLoss, trained on (activation, binary concept label) pairs. High post-training accuracy means the concept is linearly decodable from those activations; chance-level accuracy means it is not (at least not linearly). More...
|
| |
| class | LRP |
| | Whole-model LRP: runs the forward pass, seeds relevance at the chosen output(s), and propagates it to the input through every module's own propagate_relevance() rule. More...
|
| |
| struct | LRPRuleConfig |
| | Configuration for LRP relevance propagation: which rule a module applies and its hyperparameters. A module that does not implement the requested rule throws (see Module::supports_lrp_rule()) – the rule is never silently substituted. More...
|
| |
| struct | LRPTarget |
| | What LRP explains: one target class (and optionally one contrast class) per row of the network's (N, num_classes) output. More...
|
| |
| class | LSTMModule |
| | Standard 4-gate LSTM recurrence, h_0 = c_0 = 0 (zero-initialized, not learnable – the same deliberate scope cut RNNModule made, and the same thing that makes this module's conservation exact; see the LRP note below): i_t = sigmoid(x_t @ W_xi + h_{t-1} @ W_hi + b_i), f_t = sigmoid(x_t @ W_xf + h_{t-1} @ W_hf + b_f), g_t = tanh(x_t @ W_xg + h_{t-1} @ W_hg + b_g), o_t = sigmoid(x_t @ W_xo + h_{t-1} @ W_ho + b_o), c_t = f_t * c_{t-1} + i_t * g_t, h_t = o_t * tanh(c_t). Input (N, L, input_size) -> output (N, L, hidden_size), the full hidden-state sequence (matches RNNModule's convention). Single layer, no bidirectional/ multi-layer/variable-length/peephole support. More...
|
| |
| class | MambaModule |
| | Core Mamba/S6 selective-scan recurrence (Gu & Dao 2023, arXiv:2312.00752), input (N, L, d_model) -> output (N, L, d_model). More...
|
| |
| class | MaxPool2DModule |
| | Max pooling, rank-4 (N, channels, H, W), matching Conv2DModule's convention. Stride fixed equal to kernel size (non-overlapping windows), no padding, no dilation – deferred until a real use case needs them, same minimal-cut discipline as Conv2DModule's original stride-1/no-padding scope cut. More...
|
| |
| struct | MetricCapability |
| | Whether one metric can be read on this machine, and from where – or why not. More...
|
| |
| struct | MetricRecord |
| | One recorded metric value: a named tag, its value, and the training step it was logged at (mirrors MetricsSink::log_scalar's own (tag, value, step) shape). More...
|
| |
| class | MetricsSink |
| | Interface the training loop logs scalars/histograms through. Concrete writers (TensorBoard event format, W&B, CSV, ...) implement this; the training loop and Phase 4 validation harness only ever see MetricsSink. More...
|
| |
| class | MnistConvNet |
| | Conv2D(1,8,5,5) -> ReLU -> Flatten -> Linear(4608,10), trained via CrossEntropyLoss + Adam, one real MNIST image at a time (this library has no batch dimension anywhere, same constraint XorNetwork already works under). More...
|
| |
| struct | MnistDataset |
| | One IDX file pair's contents: parallel images/labels, same length. More...
|
| |
| class | MnistDatasetAdapter |
| | Adapts a pre-loaded MnistDataset (MnistIdxLoader::Load's output) onto the generic Dataset interface – minimal-diff retrofit (campaign_exai_dl_library_data_pipeline, Mission 4): MnistIdxLoader/MnistDataset themselves are unchanged, still exercised directly by mnist_loader_test.cpp; this adapter is purely additive, fulfilling mnist_loader.hpp's own note that a second real dataset is the moment to generalize. More...
|
| |
| class | MnistIdxLoader |
| | Reads MNIST's original IDX-format files directly – no format conversion, no generic Dataset abstraction. MNIST-specific by deliberate scope decision (see plan_mnist_classification_training_example.md's Recon); if a future mission needs a second real dataset, generalize then. More...
|
| |
| class | Module |
| | Base class for every layer type (LinearModule, Conv2DModule, activations, ...). More...
|
| |
| class | MSELoss |
| | MSE = mean((prediction - target)^2). More...
|
| |
| class | MultiHeadAttentionModule |
| | softmax(Q @ K^T / sqrt(head_dim)) @ V, multi-head, with optional RoPE and optional QK-Norm. Shape (N, L, d_model) -> (N, L, d_model). More...
|
| |
| class | MutationLoss |
| | Computes one of E-GAN's three named mutation objectives against a discriminator's own raw logit output, and its gradient w.r.t. those logits. Every objective trains the generator to make the discriminator's output move toward the "real" (1) class – they differ only in how that pressure is shaped (saturating vs. non-saturating vs. quadratic). More...
|
| |
| struct | NamedParamRef |
| | A parameter together with its hierarchical, dot-separated name relative to the module that reported it (weight, mha.q_proj.bias, 0.weight). More...
|
| |
| struct | NEATEvolutionResult |
| | Result of a full NEAT evolutionary run. More...
|
| |
| class | NEATGenome |
| | A NEAT genome: its node and connection genes, growable via structural mutation. More...
|
| |
| class | NegationModule |
| | y = 1 - x, elementwise. No parameters, no parameter gradients. More...
|
| |
| class | Node |
| | A single computation graph node. Owned exclusively by its ComputationGraph (see computation_graph.hpp); parent/child edges here are non-owning raw pointers into nodes the same graph owns. More...
|
| |
| struct | NodeGene |
| | One node in a NEAT genome's topology. More...
|
| |
| class | NoiseSchedule |
| | The DDPM (Ho et al. 2020, arXiv:2006.11239) linear variance schedule plus the two tensor operations defined directly on top of it – closed-form forward noising and the reverse (sampling) step. More...
|
| |
| class | NoOpMetricsSink |
| | Does nothing. The charter's stated minimum viable MetricsSink implementation. More...
|
| |
| class | NormalizeTransform |
| | Per-channel normalization: pixel = (pixel - mean[c]) / std[c]. In-place, no backend needed (same shape in and out). More...
|
| |
| struct | ParameterSpec |
| | One named parameter's description: its kind plus the bounds/categories that kind needs. Only the fields relevant to kind are meaningful (e.g. categories is empty/unused for Continuous) – this is a description, not a union, since a SearchSpace's own accessors (below) are the only place callers read it back. More...
|
| |
| struct | ParamRef |
| | A trainable parameter and its accumulated gradient, as owned by some Module. More...
|
| |
| struct | PBTResult |
| | The best-performing trial's index, its metric, and how many generations ran. More...
|
| |
| class | PBTResumableTrial |
| | A ResumableTrial that additionally exposes its live weights (a flat vector) and its current hyperparameter Configuration, both readable and replaceable mid-training. More...
|
| |
| struct | PBTTruncationGroups |
| | Indices of the population's current worst- and best-performing members. More...
|
| |
| class | PDP |
| | PDP_j(v) = (1/|B|) * sum_{b in B} f(x_j=v, x_{-j}=b_{-j}) – for each grid value v, replace every background instance's feature j with v (keeping its other features), average the model's output over the whole background set. More...
|
| |
| class | PolicyGradientLoss |
| | loss = mean_b( -log pi(a_b | s_b) * G_b ), where a_b is the action actually taken on step b of a rollout and G_b its return – the REINFORCE policy-gradient surrogate of Williams 1992. More...
|
| |
| class | PPOClippedLoss |
| | loss = mean_b( -min( r_b * A_b, clamp(r_b, 1-eps, 1+eps) * A_b ) ), where r_b = pi_new(a_b|s_b) / pi_old(a_b|s_b) – the clipped surrogate objective of Schulman et al. 2017 (arXiv:1707.06347), negated so that minimizing it maximizes the objective the paper states. More...
|
| |
| struct | QRResult |
| | QR()'s result, the thin factorization A = Q R. More...
|
| |
| struct | RecurrentCellArgs |
| | Operand pointers for DeviceBackend::recurrent_cell (passed to kernels by value). More...
|
| |
| class | ReluModule |
| | y = max(x, 0), elementwise. No parameters, no parameter gradients. More...
|
| |
| class | Reparameterize |
| | VAE reparameterization trick (Kingma & Welling 2013, arXiv:1312.6114), z[b,d] = mu[b,d] + exp(log_sigma[b,d]) * epsilon[b,d]. More...
|
| |
| struct | ReparamGrad |
| | The (grad_mu, grad_log_sigma) pair both VAE building blocks produce. More...
|
| |
| struct | ReplayBatch |
| | One uniformly-sampled minibatch of transitions, one Tensor per transition field. More...
|
| |
| class | ReplayBuffer |
| | Fixed-capacity circular replay buffer of (observation, action, reward, next_observation, done) transitions, with uniform-random-with-replacement batch sampling – the off-policy experience store of Mnih et al. 2015 (DQN), reused unchanged by SAC and every other off-policy learner in this campaign. More...
|
| |
| class | ResampleTransform |
| | Resamples a waveform (sample.fields[0], shape (1, channels, num_samples) – WavReader's/AudioFolderDataset's convention) from source_sample_rate to target_sample_rate via linear interpolation. More...
|
| |
| class | ResidualModule |
| | y = x + inner->forward(x) for an arbitrary already-built Module. The classic ResNet shortcut connection, owning its own native relevance-split rule – the charter's explicitly named failure mode to avoid is Captum/Zennit's "Canonizer
surgery" (an external post-hoc graph rewrite for residual connections). More...
|
| |
| class | ResizeTransform |
| | Every transform in this file operates on sample.fields[0], assumed to be an image Tensor of shape (1, channels, height, width) – the convention MnistDatasetAdapter, CsvDataset, and ImageDecoder all already share (image/features first, label last). More...
|
| |
| class | ResumableTrial |
| | A single hyperparameter configuration's live, resumable training state – own whatever network/optimizer/dataset a concrete trial needs, and train it incrementally across multiple calls rather than all at once. More...
|
| |
| class | RetNetModule |
| | Core RetNet retention block (Sun et al. 2023, arXiv:2307.08621), recurrent mode, input (N, L, d_model) -> output (N, L, d_model). More...
|
| |
| struct | RgbColor |
| | An RGB color, each channel in [0, 1]. More...
|
| |
| struct | RgbImageBuffer |
| | An interleaved-RGB, row-major byte buffer ready for a texture upload. More...
|
| |
| struct | RlRowArgs |
| | Operand pointers and dims for DeviceBackend::rl_rows (passed to kernels by value). More...
|
| |
| class | RMSNormModule |
| | y_{n,i} = gamma_i * x_{n,i} / rms(x_n), rms(x_n) = sqrt(mean_i(x_{n,i}^2) + eps), computed independently per batch row n. Batched ((N, num_features)), migrated from the original unbatched (rank-1) scope by campaign_exai_dl_library_batch_dimension_support – no mean-centering, no beta/bias term (RMSNorm's defining simplification vs. LayerNorm). More...
|
| |
| class | RNNModule |
| | h_t = tanh(x_t @ W_xh + h_{t-1} @ W_hh + b_h), h_0 = 0 (zero-initialized, not learnable – a deliberate scope cut, see the class-level conservation note below). Input (N, L, input_size) -> output (N, L, hidden_size), the full hidden-state sequence. Single layer, tanh only, no bidirectional/multi-layer/ variable-length support. More...
|
| |
| struct | RolloutBatch |
| | One whole stored rollout, reduced to what a policy-gradient update consumes: the visited observations, the actions taken, the discounted return-to-go of each step, and the log-probability the acting policy assigned to each action. More...
|
| |
| class | RolloutBuffer |
| | Fixed-length, fill-once on-policy trajectory buffer of (observation, action, reward, log_prob, done) steps, with discounted return-to-go computation – the storage REINFORCE/A2C/PPO collect a rollout into. More...
|
| |
| class | RoPEModule |
| | Rotary Position Embedding (RoPE, Su et al. 2021): a fixed, non-learnable, position-dependent rotation of each adjacent feature pair of a Q/K-shaped tensor. More...
|
| |
| class | RWKVModule |
| | Core RWKV-4 time-mixing block (Peng et al. 2023, arXiv:2305.13048), input (N, L, d_model) -> output (N, L, d_model). More...
|
| |
| class | SafetensorsFile |
| | A parsed, fully validated safetensors file held in memory. More...
|
| |
| struct | SafetensorsTensorInfo |
| | One tensor's header entry. Offsets are relative to the start of the data section. More...
|
| |
| class | Saliency |
| | Raw-gradient saliency: d(output[target_index])/d(input), computed by seeding ExplainerContext::backward_pass with a one-hot vector at target_index. More...
|
| |
| class | SaliencyHeatmapView |
| | Draws a 2D saliency heatmap plus a colormap scale bar. Unsigned magnitudes (e.g. Grad-CAM) use Viridis (perceptually uniform, colorblind-safe – hc_information_visualization.md SS4) over [0, max]; signed attributions (any negative value – gradients, IG, LRP, LIME, SHAP) use the blue-white-red DivergingColormap over the symmetric range [-max|v|, +max|v|], so zero is always the neutral midpoint. The choice is ComputeHeatmapColorScale's (plot_data.hpp, unit-tested). Row 0 of the grid is drawn at the top (image convention) with square cells. More...
|
| |
| struct | Sample |
| | One dataset sample: an ordered list of Tensor fields (e.g. {features, label} or {image, label}). Field order/count is a contract between a Dataset implementation and whatever CollateFn (collate.hpp) later assembles samples into a Batch. More...
|
| |
| class | Sampler |
| | Produces the order in which a DataLoader visits a Dataset's indices for one epoch. More...
|
| |
| class | SatisfactionLoss |
| | loss = 1 - agg_p(truth_values) – the standard LTN "Real Logic" training objective (research_2026_neuro_symbolic_ai.md §1/§2): maximizing a knowledge base's aggregated satisfaction via ordinary gradient descent is the same as minimizing this loss. More...
|
| |
| struct | ScalarSeries |
| | One scalar tag's logged (step, value) pairs, in log order. More...
|
| |
| struct | ScoreCardScaleContext |
| | Shared axis/color-scale state across several ExplanationScoreCard instances shown together (small multiples – hc_information_visualization.md SS6), so each card's attribution bar chart uses a comparable scale rather than independently auto-scaling and silently making cross-card comparison invalid. More...
|
| |
| class | SearchSpace |
| | Describes a hyperparameter search space as an ordered list of named, typed parameters. Every HPO algorithm (grid/random search, GP-BO, TPE, Hyperband/ASHA) consumes a SearchSpace to know what it may propose; this type itself has no sampling logic (that is each algorithm's own job, e.g. RandomSample/GridSample). More...
|
| |
| class | SequentialModule |
| | Composes layers_[0..n-1] in forward() order; backward()/propagate_relevance() chain layers_[n-1..0] in reverse – correct reverse-mode composition order. More...
|
| |
| class | SequentialSampler |
| | Visits indices [0, dataset_size) in ascending order. More...
|
| |
| class | SGDOptimizer |
| | param -= learning_rate * grad, per parameter, for every parameter a Module exposes. More...
|
| |
| class | Shape |
| | An N-dimensional shape. A plain aggregate of dimensions with no invariant beyond "non-negative dimensions" – see oop_design/context_oop_design_fundamentals.md's struct-vs-class discussion for why this is still a class (numel()/is_reshape_compatible() are derived queries, not raw public fields the caller could desync from dims_). More...
|
| |
| class | ShuffleSampler |
| | Visits indices [0, dataset_size) in a seeded pseudo-random permutation – reproducible across runs given the same seed (std::mt19937), re-shuffled fresh each reset() call (a new epoch is a new permutation, not the same one repeated). More...
|
| |
| class | SoftmaxModule |
| | Softmax over the tensor's last dimension, applied independently to every "row" (every fixed combination of all leading dimensions). More...
|
| |
| class | SparseAutoencoder |
| | A sparse autoencoder (SAE): LinearModule(dim, hidden_dim) -> ReluModule -> LinearModule(hidden_dim, dim), trained with MSELoss to reconstruct its own input while an L1 penalty on the hidden ReLU activation pushes most hidden units to zero on any given example. More...
|
| |
| struct | SpeciesAssignment |
| | Population grouping into species: each inner vector is a list of indices into the population vector that were passed to SpeciatePopulation. More...
|
| |
| struct | SsmPassArgs |
| | Operand pointers and dims for DeviceBackend::ssm_pass (passed to kernels by value). More...
|
| |
| struct | StabilityResult |
| | The result of measuring an explainer's variance across repeated runs on the same input. More...
|
| |
| struct | StepResult |
| | What one Environment::step() produces: the next observation, this step's reward, and whether the episode ended. More...
|
| |
| class | SubTBLoss |
| | One sub-trajectory pair's contribution to the SubTB(λ) loss: Δ(i,j) = log F(s_i) + Σ log P_F − log F(s_j) − Σ log P_B (summed over the edges spanned by [i,j)), weighted by ‘pair_weight_ratio = λ^{j-i} / Σ_{i’<j'} λ^{j'-i'}` (the pre-normalized share of the total weighted-average loss this specific pair contributes). More...
|
| |
| struct | SuccessiveHalvingResult |
| | The winning configuration, its final metric, and the total epoch-budget actually spent across every trial/rung (the exit-gate's own "reduces total training
compute" measure). More...
|
| |
| struct | SVDResult |
| | SVD()'s result, the thin factorization A = U diag(S) V^T with k = min(m, n). More...
|
| |
| class | SwiGLUModule |
| | down_proj(silu(gate_proj(x)) * up_proj(x)), the gated feedforward block used in place of a plain two-linear-layer MLP in most modern transformers. Rank-agnostic over (..., d_model) -> (..., d_model), matching MultiHeadAttentionModule's I/O contract so Phase 3 Mission 5 (TransformerBlock) can chain them directly. More...
|
| |
| class | SystemMonitor |
| | Samples CPU/GPU utilization, memory use and temperatures on a background thread, keeps a bounded in-memory history, and streams every sample to a log file. More...
|
| |
| struct | SystemSample |
| | One point-in-time measurement of the host. More...
|
| |
| struct | TanhGaussianGrad |
| | The (grad_mean, grad_log_std) pair TanhGaussianPolicy::backward() produces – both (N, action_dim), the shape of the forward's own mean/log_std. More...
|
| |
| class | TanhGaussianPolicy |
| | SAC's reparameterized, tanh-squashed Gaussian policy sample (Haarnoja et al. 2018, arXiv:1801.01290, Appendix C "Enforcing Action Bounds"): u = mean + exp(log_std) * epsilon, action = tanh(u), with the change-of-variables corrected log-density log_prob = sum_d [ -0.5*epsilon^2 - log_std - 0.5*log(2*pi) - log(1 - action^2 + 1e-6) ]. More...
|
| |
| struct | TanhGaussianSample |
| | The (action, log_prob) pair TanhGaussianPolicy::forward() produces. More...
|
| |
| class | Tensor |
| | N-dimensional tensor. Owns its data buffer exclusively; a DeviceBackend* is injected (not owned) – the backend must outlive every Tensor constructed against it, per cpp_style_guide/context_style_project_conventions.md's ownership table. More...
|
| |
| class | TextDataset |
| | Dataset over a line-delimited text corpus: each line becomes one sample, tokenized via Tokenizer::Tokenize and indexed via a Vocabulary into a (1, seq_len) float32 Tensor of token indices – Decision Point 6's resolved representation (token IDs as float32 values, the same integer-as-float32 pattern CsvDataset's label column and MnistDatasetAdapter's class label already use). seq_len varies per sample; no padding here (see PadCollate, Mission 10) – an empty line produces a zero-element (1, 0) Tensor, a valid, non-error Tensor state. More...
|
| |
| class | TextureCache |
| | Uploads decoded image Tensors to OpenGL textures, keyed and cached by an arbitrary integer key (e.g. a Dataset index) so a scrolling image grid doesn't re-upload the same image every frame. More...
|
| |
| class | Tokenizer |
| | Splits text into lowercase word/punctuation tokens – pulsatrix's first text primitive (campaign_exai_dl_library_data_pipeline, Phase 3, Decision Point 6: a minimal whitespace/punctuation tokenizer, not BPE – training a real subword-merge algorithm is a project-sized undertaking on its own). More...
|
| |
| struct | TopKResult |
| | top_k()'s result: the selected values and their positions along the last dimension. More...
|
| |
| class | ToyKnowledgeBase |
| | A small, hand-traceable knowledge base: two neural predicates A(x)/B(x) (each a sigmoid-squashed LinearModule(1,1), producing a fuzzy truth degree in (0,1)), one logical rule A(x) -> not(B(x)), expressed via De Morgan (not(A(x)) or not(B(x)), Product t-conorm/t-negation) using only NegationModule/DisjunctionModule (Mission 0) – no dedicated Implication Module – aggregated across synthetic groundings into one scalar via SatisfactionLoss (Mission 1). More...
|
| |
| class | TrainingDashboard |
| | Draws a live training dashboard: a data-ink-minimal per-tag summary line (last/min/max value, current step – Tufte SS6: no chartjunk, just the numbers that matter) followed by ImPlotMetricsSink's line charts and histogram snapshots. More...
|
| |
| class | TrajectoryBalanceLoss |
| | Δ(τ) = log Zθ + Σ log P_F(s_{t+1}|s_t) − log R(x) − Σ log P_B(s_t|s_{t+1}), loss = Δ(τ)². More...
|
| |
| class | Transform |
| | A single sample-level preprocessing step (normalize, augment, tokenize, ...). More...
|
| |
| class | TransformDataset |
| | Decorates a Dataset with a Transform, applied to every sample get() returns – lets Transform/Compose compose with any Dataset without modifying it or DataLoader. More...
|
| |
| class | TransformerBlock |
| | y1 = x + MHA(RMSNorm(x)), y2 = y1 + SwiGLU(RMSNorm(y1)). Shape (N, L, d_model) -> (N, L, d_model). More...
|
| |
| class | Trial |
| | A configuration paired with the metric history observed while evaluating it (instantiate a network under this configuration, train it, record whatever metrics the training loop reports). Deliberately decoupled from SearchSpace – a Trial records what actually happened, a SearchSpace describes what could be proposed; neither needs to reference the other directly. More...
|
| |
| class | UniformFrameSampleTransform |
| | Samples num_frames evenly-spaced frames from a clip Tensor (sample.fields[0], shape (T, C, H, W) – VideoFrameDirectoryDataset's convention), producing an (N, C, H, W) Tensor – deliberately identical in shape convention to Phase 2's image Dataset/Transform outputs (ImageFolderDataset, ResizeTransform, etc.): a video clip, once frame-sampled, is just a batch of images from this codebase's perspective. More...
|
| |
| struct | ValidationIssue |
| | One detected data-quality issue: a missing (NaN) value or a statistical outlier. More...
|
| |
| class | VideoFrameDirectoryDataset |
| | Dataset over a directory tree of the form root_dir/<class_name>/<clip_name>/<sequentially-named-frame-image>, decoding each clip's frames (via ImageDecoder) into one (T, C, H, W) Tensor per sample. More...
|
| |
| class | VizWindow |
| | Owns a GLFW window, OpenGL3 context, and ImGui/ImPlot context for the lifetime of one demo app. Every examples/viz/*_demo.cpp uses this instead of hand-rolling the standard imgui_impl_glfw_opengl3 boilerplate. More...
|
| |
| class | Vocabulary |
| | Token<->index lookup table. Index 0 is always the reserved "<unk>" token – guaranteed by construction, not caller convention: the constructor takes the ranked list of real tokens and prepends "<unk>" itself. More...
|
| |
| struct | WaterfallBar |
| | One floating waterfall bar: spans [bottom, top] on the value axis. More...
|
| |
| struct | WaterfallStep |
| | One waterfall step: a labeled delta and the running cumulative value after it. More...
|
| |
| struct | WavData |
| | One decoded WAV file's contents: waveform Tensor plus its sample rate. More...
|
| |
| class | WavReader |
| | Reads uncompressed 16-bit PCM WAV files directly – pulsatrix's first audio primitive (campaign_exai_dl_library_data_pipeline, Phase 4, Decision Point 4: hand-rolled over libsndfile, same "narrowest thing that satisfies the exit gate" reasoning as Decision Points 1/2/6). More...
|
| |
| class | XorNetwork |
| | A tiny MLP (Linear(2,4) -> ReLU -> Linear(4,1)) trained on XOR – the canonical not-linearly-separable case, exactly representable by a small MLP, giving an unambiguous convergence target for Phase 1's "prove the training loop works" goal. More...
|
| |
|
| double | StandardNormalPdf (double z) |
| | Standard normal PDF, phi(z) = (1/sqrt(2*pi)) * exp(-z^2/2).
|
| |
| double | StandardNormalCdf (double z) |
| | Standard normal CDF, Phi(z) = 0.5 * (1 + erf(z / sqrt(2))).
|
| |
| double | ExpectedImprovement (double mean, double variance, double best_value, double xi=0.01) |
| | Expected Improvement: the expected amount by which a candidate exceeds best_value + xi, under the posterior N(mean, variance).
|
| |
| double | ProbabilityOfImprovement (double mean, double variance, double best_value, double xi=0.01) |
| | Probability of Improvement: P(candidate's value > best_value + xi) under the posterior N(mean, variance).
|
| |
| double | UpperConfidenceBound (double mean, double variance, double kappa=2.0) |
| | GP-Upper-Confidence-Bound: mean + kappa * sqrt(variance).
|
| |
| ASHAResult | RunASHAOnConfigQueue (std::vector< Configuration > config_queue, const TrialFactory &make_trial, int initial_epoch_budget, double eta, int num_rungs) |
| | Runs ASHA, drawing new configurations from an explicit, ordered queue (rather than sampling indefinitely) – the pure, deterministic core; RunASHA (below) is the thin SearchSpace/RNG-sampling wrapper around it.
|
| |
| template<typename RNG > |
| ASHAResult | RunASHA (const SearchSpace &space, const TrialFactory &make_trial, size_t max_configs_started, int initial_epoch_budget, double eta, int num_rungs, RNG &rng) |
| | RNG-driven wrapper: draws max_configs_started configurations from space via RandomSample to serve as the queue, then runs RunASHAOnConfigQueue.
|
| |
| CollateFn | AudioPadCollate () |
| | Builds a CollateFn that zero-pads (silence) variable-length waveforms (sample.fields[0], shape (1, channels, num_samples) – WavReader's/ AudioFolderDataset's convention) to the batch's own max sample count, producing one (N, channels, max_samples) Tensor, plus a (N,) length field. Phase 4's version of PadCollate (Phase 3, text) – a second proof that the CollateFn extension point handles ragged/variable-length modalities with zero Dataset/DataLoader/Batch interface changes.
|
| |
| std::vector< std::vector< double > > | AskGivenSamples (const CMAESState &state, const std::vector< std::vector< double > > &z_samples) |
| | Pure core: decodes an explicit set of standard-normal sample vectors into offspring points, x_i = mean + sigma * sqrt(variances) (elementwise) * z_i.
|
| |
| CMAESState | TellGivenSamples (const CMAESState &state, const std::vector< std::vector< double > > &z_samples, const std::vector< std::vector< double > > &offspring, const std::vector< double > &fitness, double step_size_learning_rate, double scale_learning_rate) |
| | Pure core: given the offspring AskGivenSamples produced (same order), their maximization-convention fitness values, and the z_samples that produced them, returns the next generation's state.
|
| |
| Batch | DefaultCollate (std::vector< Sample > samples, DeviceBackend *backend) |
| | Stacks a list of samples into one Batch, field-by-field, via Tensor::Stack – pulsatrix's default CollateFn (PyTorch's default_collate analogue).
|
| |
| template<typename T > |
| std::pair< std::vector< T >, std::vector< T > > | OnePointCrossoverAtPoint (const std::vector< T > &parent1, const std::vector< T > &parent2, size_t point) |
| | Splits both parents at point and swaps tails.
|
| |
| template<typename T , typename RNG > |
| std::pair< std::vector< T >, std::vector< T > > | OnePointCrossover (const std::vector< T > &parent1, const std::vector< T > &parent2, RNG &rng) |
| | RNG-driven wrapper: draws an interior point in [1, size-1] uniformly.
|
| |
| template<typename T > |
| std::pair< std::vector< T >, std::vector< T > > | TwoPointCrossoverAtPoints (const std::vector< T > &parent1, const std::vector< T > &parent2, size_t point1, size_t point2) |
| | Swaps the [point1, point2) segment between both parents.
|
| |
| template<typename T , typename RNG > |
| std::pair< std::vector< T >, std::vector< T > > | TwoPointCrossover (const std::vector< T > &parent1, const std::vector< T > &parent2, RNG &rng) |
| | RNG-driven wrapper: draws two points in [0, size], sorted ascending.
|
| |
| template<typename T > |
| std::pair< std::vector< T >, std::vector< T > > | UniformCrossoverByMask (const std::vector< T > &parent1, const std::vector< T > &parent2, const std::vector< bool > &swap_mask) |
| | Swaps each gene independently wherever swap_mask is true.
|
| |
| template<typename T , typename RNG > |
| std::pair< std::vector< T >, std::vector< T > > | UniformCrossover (const std::vector< T > &parent1, const std::vector< T > &parent2, double swap_probability, RNG &rng) |
| | RNG-driven wrapper: each gene swaps independently with probability swap_probability.
|
| |
| std::pair< std::vector< double >, std::vector< double > > | BlendCrossoverByGamma (const std::vector< double > &parent1, const std::vector< double > &parent2, const std::vector< double > &gamma) |
| | Blends each gene pair via an explicit per-gene gamma: child1_i = (1-gamma_i)*x1_i + gamma_i*x2_i, child2_i = gamma_i*x1_i + (1-gamma_i)*x2_i.
|
| |
| template<typename RNG > |
| std::pair< std::vector< double >, std::vector< double > > | BlendCrossover (const std::vector< double > &parent1, const std::vector< double > &parent2, double alpha, RNG &rng) |
| | RNG-driven wrapper (DEAP's cxBlend): draws gamma_i = (1+2*alpha)*u_i - alpha per gene, u_i ~ Uniform(0, 1).
|
| |
| std::pair< std::vector< double >, std::vector< double > > | SimulatedBinaryCrossoverByDraw (const std::vector< double > &parent1, const std::vector< double > &parent2, double eta, const std::vector< double > &draws) |
| | Simulated binary crossover (Deb & Agrawal 1995; DEAP's cxSimulatedBinary), given an explicit per-gene draw in [0, 1).
|
| |
| template<typename RNG > |
| std::pair< std::vector< double >, std::vector< double > > | SimulatedBinaryCrossover (const std::vector< double > &parent1, const std::vector< double > &parent2, double eta, RNG &rng) |
| | RNG-driven wrapper: draws u_i ~ Uniform(0, 1) per gene (std::uniform_real_distribution is documented to produce values in [0, 1), matching the pure core's requirement).
|
| |
| void | set_seed (uint64_t seed) |
| | Sets the global seed and restarts the seed stream next_seed() draws from.
|
| |
| uint64_t | global_seed () |
| | The seed most recently passed to set_seed() (0 by default).
|
| |
| uint64_t | next_seed () |
| | The next seed in the global stream: a distinct, well-mixed 64-bit value per call, reproducible for a given global seed. Components built without an explicit seed take theirs from here, so two of them never share a random stream by accident.
|
| |
| void | set_deterministic (bool enabled) |
| | Turns deterministic mode on (the default) or off.
|
| |
| bool | deterministic () |
| | Whether deterministic mode is on.
|
| |
| void | check_deterministic_allowed (const char *operation) |
| | Guard for a nondeterministic code path: call it before running one.
|
| |
| Tensor | ComputeDQNTarget (const Tensor &next_q_target, const Tensor &rewards, const Tensor &dones, float gamma, DeviceBackend *backend) |
| | Vanilla DQN Bellman target (Mnih et al. 2015): targets[b,0] = rewards[b,0] + gamma * (1 - dones[b,0]) * max_a next_q_target[b,a].
|
| |
| Tensor | ComputeDoubleDQNTarget (const Tensor &next_q_online, const Tensor &next_q_target, const Tensor &rewards, const Tensor &dones, float gamma, DeviceBackend *backend) |
| | Double DQN Bellman target (van Hasselt et al. 2016, arXiv:1509.06461): a* = argmax_a next_q_online[b,a], then targets[b,0] = rewards[b,0] + gamma * (1 - dones[b,0]) * next_q_target[b, a*].
|
| |
| void | SyncTargetNetwork (Module &source, Module &destination) |
| | Hard target-network update: copies every parameter value of source into destination, element-wise and in place (Mnih et al. 2015's periodic full copy).
|
| |
| float | QualityFitness (const Tensor &logits) |
| | E-GAN's own quality fitness Fq: mean sigmoid(D(fake)) over the batch – how convincingly "real" the discriminator currently rates these samples. Higher is better (the discriminator being fooled more).
|
| |
| float | DiversityFitness (Module &discriminator, const Tensor &fake, DeviceBackend *backend) |
| | E-GAN's own diversity fitness Fd = -log(||grad||): the negative log of the L2 norm of the discriminator's own parameter gradient from its fake-recognition loss term (BCEWithLogitsLoss(D(fake), 0)), evaluated on fake. A smaller discriminator gradient here means the discriminator is already close to a local optimum against these particular samples – the paper's own signal that this offspring is contributing mode coverage the discriminator can't easily exploit further (discourages mode collapse).
|
| |
| float | CombinedFitness (float quality, float diversity, float gamma=0.05f) |
| | Combined E-GAN fitness: Fq + gamma*Fd (Wang et al. 2019's own weighted combination). gamma's default (0.05) is this mission's own reasonable working value, not a literal reproduction of the paper's own tuned constant (never stated precisely enough there to reproduce exactly) – a deliberate, documented choice, not an assumed one.
|
| |
| template<typename OptimizerT > |
| float | RunMutationStep (Module &offspring, Module &discriminator, const Tensor &noise, MutationObjective objective, OptimizerT &g_optimizer, DeviceBackend *backend, float gamma=0.05f) |
| | Runs one E-GAN mutation training step: trains offspring (an already-independent Module instance – typically initialized as a copy of some parent's current weights, which this function does not itself construct or assume anything about) for one step against discriminator using the given objective, then scores the mutated result via CombinedFitness on offspring's own post-mutation samples.
|
| |
| template<typename MakeGenerator , typename DOptimizerT > |
| std::vector< float > | RunEGANGeneration (GeneratorPopulation &population, Module &discriminator, const Tensor &real_batch, const std::vector< Tensor > &noise_per_generator, const std::vector< MutationObjective > &objectives, MakeGenerator make_generator, float g_learning_rate, DOptimizerT &d_optimizer, DeviceBackend *backend, float gamma=0.05f) |
| | Runs one E-GAN generation: for every population member, attempts every objective in objectives (each against a fresh weight-copy offspring built by make_generator + RestoreParameters), keeps the best-combined-fitness offspring, replaces that population slot with it, then trains discriminator on real_batch plus the now-mutated population's own pooled fake output.
|
| |
| template<typename MakeGenerator , typename DOptimizerT , typename RNG > |
| void | RunEGANTraining (GeneratorPopulation &population, Module &discriminator, const Tensor &real_batch, int num_generations, int64_t noise_dim, int64_t per_generator_batch, const std::vector< MutationObjective > &objectives, MakeGenerator make_generator, float g_learning_rate, DOptimizerT &d_optimizer, DeviceBackend *backend, RNG &rng, float gamma=0.05f) |
| | RNG-driven wrapper: draws fresh standard-normal noise for every population member every generation, then runs RunEGANGeneration num_generations times.
|
| |
| std::vector< double > | ESUpdateGivenPerturbations (const std::vector< double > &theta, const std::vector< std::vector< double > > &epsilons, const std::vector< double > &fitnesses, double alpha, double sigma) |
| | Pure core: the exact ES parameter update given already-sampled perturbations and their fitness scores – ‘theta’ = theta + (alpha / (N*sigma)) * sum_i(F_i * epsilon_i)`.
|
| |
| template<typename FitnessFn , typename RNG > |
| std::vector< double > | ESStep (const std::vector< double > &theta, FitnessFn fitness_fn, int population_size, double sigma, double alpha, RNG &rng) |
| | RNG-driven wrapper: samples population_size/2 standard-normal perturbation vectors, scores theta+sigma*epsilon and theta-sigma*epsilon for each (mirrored sampling), and returns the updated theta via ESUpdateGivenPerturbations.
|
| |
| template<typename FitnessFn , typename RNG > |
| ESResult | RunEvolutionStrategies (std::vector< double > theta, FitnessFn fitness_fn, int num_iterations, int population_size, double sigma, double alpha, RNG &rng) |
| | Runs num_iterations of Evolution Strategies starting from theta, tracking the best (theta, fitness) pair seen across every evaluated center point (global elitism, the same precedent this campaign's NEAT evolutionary loop already established) – vanilla ES itself has no such tracking, but a returnable "best point found" is genuinely necessary for this to be usable as an optimizer, so it is added here as a small, logged addition beyond the paper's own bare update rule.
|
| |
| template<typename Genotype , typename FitnessT , typename FitnessFn > |
| void | EvaluatePopulation (std::vector< Individual< Genotype, FitnessT > > &population, FitnessFn &fitness_fn, DataThreadPool *thread_pool) |
| | Evaluates (or re-evaluates) every individual's fitness in place via fitness_fn.
|
| |
| template<typename Genotype , typename FitnessT , typename FitnessFn , typename OffspringFn , typename SurvivorFn > |
| std::vector< Individual< Genotype, FitnessT > > | RunEvolutionaryLoop (std::vector< Individual< Genotype, FitnessT > > population, size_t num_generations, size_t lambda_size, FitnessFn fitness_fn, OffspringFn produce_offspring_genotype, SurvivorFn survivor_selector, DataThreadPool *thread_pool=nullptr) |
| | Runs num_generations of the shared evolutionary-loop skeleton: evaluate -> produce lambda_size offspring (via produce_offspring_genotype, called once per offspring) -> evaluate offspring -> survivor-select mu individuals for the next generation.
|
| |
| StabilityResult | ComputeAttributionStability (const std::vector< Attribution > &repeated_runs) |
| | Measures an explainer's stability across repeated runs on the same input (charter's "repeated-run variance measured and documented" audit category). Known-unstable methods (LIME, KernelSHAP) are expected to show is_deterministic == false; every other native/surrogate explainer in this codebase is deterministic by construction.
|
| |
| double | FixedTopologyXORForward (const std::vector< double > &theta, const std::array< double, 2 > &inputs) |
| | Forward pass: theta layout is [w1_00, w1_01, b1_0, w1_10, w1_11, b1_1, w2_0, w2_1, b2] – h_j = sigmoid(w1_j0*x0 + w1_j1*x1 + b1_j) for j in {0,1}, y = sigmoid(w2_0*h0 + w2_1*h1 + b2).
|
| |
| double | FixedTopologyXORFitness (const std::vector< double > &theta) |
| | Scores theta against all four XOR patterns as 4.0 minus the sum of squared errors – identical convention to XORFitness (neat_xor_fitness.hpp), so an all-zero theta scores exactly 3.0 (every pattern outputs sigmoid(0)=0.5), the same fixed point NEAT's own fresh, all-zero-weight genome scores.
|
| |
| GAEResult | ComputeGAE (const Tensor &rewards, const Tensor &dones, const Tensor &values, float bootstrap_value, float gamma, float lambda, DeviceBackend *backend) |
| | Generalized Advantage Estimation (Schulman et al. 2016, arXiv:1506.02438): the exponentially-weighted average of k-step advantage estimators, computed in one reverse pass.
|
| |
| Tensor | SliceBatch (const Tensor &t, int64_t start, int64_t count, DeviceBackend *backend) |
| | Extracts rows [start, start+count) along t's leading dimension into a new Tensor – the inverse of Tensor::Stack, needed to split a pooled discriminator gradient back into each population member's own slice.
|
| |
| std::vector< float > | FlattenParameters (Module &module) |
| | Flattens every parameter tensor module.parameters() reports (in that order) into one vector – the concrete mechanism Phase 5 Mission 2's mutation-offspring construction uses to copy a parent generator's current weights into a freshly-constructed (architecturally identical) offspring instance before mutating the copy.
|
| |
| void | RestoreParameters (Module &module, const std::vector< float > &flat) |
| | Overwrites every parameter tensor module.parameters() reports (in that order) from flat – the inverse of FlattenParameters.
|
| |
| void | ZeroModuleGradients (Module &module) |
| | Zeros every gradient tensor module.parameters() reports – a standalone alternative to calling some optimizer's own zero_grad(module) when no persistent per-module optimizer instance is being kept around (Phase 5 Mission 2's own mutation-attempt loop constructs a fresh optimizer per attempt, so there is no single optimizer instance left to call zero_grad on between generations).
|
| |
| Tensor | GeneratePooledFakeSamples (GeneratorPopulation &population, const std::vector< Tensor > &noise_per_generator, DeviceBackend *backend) |
| | Runs every population member's generator forward on its own noise batch (noise_per_generator[i] for population member i), then pools the results (Tensor::Stack, concatenated along the batch dimension, in population order) into one combined fake-sample batch – the discriminator's own training input in E-GAN.
|
| |
| void | BackwardThroughPopulation (GeneratorPopulation &population, const Tensor &pooled_grad, const std::vector< int64_t > &batch_sizes, DeviceBackend *backend) |
| | Given pooled_grad (the gradient w.r.t. the pooled fake batch GeneratePooledFakeSamples produced – e.g. from discriminator.backward() called after a forward on that pooled batch), routes each population member's own slice back through that member's own backward() – the concrete mechanism that lets one shared discriminator train against every generator's own output while each generator's own parameters still receive exactly its own correct gradient.
|
| |
| GFlowNetTrajectory | sample_gflownet_trajectory (HyperGridEnv &env, GFlowNetForwardPolicy &forward_policy) |
| | Samples one full trajectory: resets env, then repeatedly samples a masked action from forward_policy and steps env until termination (an explicit stop or env's own max_steps cap).
|
| |
| Configuration | UnitCubeToConfiguration (const SearchSpace &space, const std::vector< float > &t) |
| | Maps a unit-hypercube point (one value per parameter, each in [0, 1]) to a Configuration, using space's own declared bounds.
|
| |
| template<typename ObjectiveFn , typename RNG > |
| std::vector< Trial > | RunGPBOLoop (const SearchSpace &space, ObjectiveFn objective_fn, size_t num_initial_random, size_t num_iterations, AcquisitionKind acquisition, size_t num_candidates, RNG &rng) |
| | Runs GP-BO: num_initial_random uniformly-random trials, then num_iterations trials each chosen by fitting a GP to every trial so far and maximizing acquisition over num_candidates random points in the unit hypercube.
|
| |
| Configuration | DecodeGenotype (const SearchSpace &space, const std::vector< double > &genotype) |
| | Decodes a unit-hypercube genotype into a Configuration using space's own declared bounds: Continuous linearly, LogUniform geometrically (both identical to gp_bo.hpp's UnitCubeToConfiguration); Integer by linear interpolation then rounding to the nearest integer (std::round – ties away from zero, portable); Categorical by linear interpolation into an index, floored, clamped to the last category (handles the gene == 1.0 boundary, which would otherwise floor to one-past-the-end).
|
| |
| template<typename RNG > |
| Configuration | RandomSample (const SearchSpace &space, RNG &rng) |
| | Draws one configuration uniformly at random from space: Continuous parameters uniform over [lower, upper]; LogUniform parameters uniform in log-space (so e.g. [0.001, 1.0] gives 0.001-0.01, 0.01-0.1, and 0.1-1.0 equal probability, not the top decade 90% of the draws); Integer parameters uniform over the inclusive integer range; Categorical parameters uniform over the category list.
|
| |
| std::vector< Configuration > | GridSample (const SearchSpace &space, size_t points_per_continuous_dimension) |
| | Enumerates the full cartesian-product grid over space.
|
| |
| std::vector< HyperbandBracket > | ComputeHyperbandBrackets (int max_resource, double eta) |
| | Computes the classic Hyperband bracket schedule: s_max = floor(log_eta(max_resource)), B = (s_max + 1) * max_resource; for s from s_max down to 0, num_configs = ceil((B / max_resource) * (eta^s / (s + 1))), initial_budget = round(max_resource / eta^s) (each floored at 1).
|
| |
| template<typename RNG > |
| HyperbandResult | RunHyperband (const SearchSpace &space, const TrialFactory &make_trial, int max_resource, double eta, RNG &rng) |
| | Runs one Successive Halving bracket (successive_halving.hpp) per ComputeHyperbandBrackets(max_resource, eta), keeping the best result across all of them.
|
| |
| std::vector< float > | SolveLinearSystem (std::vector< std::vector< float > > a, std::vector< float > b) |
| | Solves A*x = b via Gaussian elimination with partial pivoting.
|
| |
| ConservationResult | ComputeConservation (const Tensor &relevance_in, const Tensor &relevance_out) |
| | Sums relevance_in and relevance_out independently and reports their gap.
|
| |
| std::string | lrp_rule_name (LRPRule rule) |
| | Lower-case rule name ("epsilon", "gamma", "alpha_beta", "zbox") for messages/metadata.
|
| |
| EigenResult | SymmetricEigen (const Tensor &a) |
| | All eigenvalues and eigenvectors of a symmetric matrix, by Householder reduction to tridiagonal form followed by QL with implicit shifts.
|
| |
| DominantEigenResult | PowerIteration (const Tensor &a, int64_t max_iterations=1000, float tolerance=1e-6f, uint64_t seed=0) |
| | The dominant eigenpair of a symmetric matrix by power iteration – cheaper than SymmetricEigen() when only the top eigenpair is needed (spectral norm, stable rank).
|
| |
| QRResult | QR (const Tensor &a) |
| | Thin QR factorization by Householder reflections.
|
| |
| SVDResult | SVD (const Tensor &a) |
| | Thin singular value decomposition by one-sided (Hestenes) Jacobi rotations.
|
| |
| void | append_named_parameters (std::vector< NamedParamRef > &out, const std::string &prefix, Module &child) |
| | Appends child's named parameters to out, each renamed to prefix.name – the one step every container's named_parameters() repeats per child.
|
| |
| std::vector< bool > | BitFlipMutationByMask (const std::vector< bool > &genotype, const std::vector< bool > &flip_mask) |
| | Flips each gene where flip_mask is true, leaves the rest unchanged.
|
| |
| template<typename RNG > |
| std::vector< bool > | BitFlipMutation (const std::vector< bool > &genotype, double mutation_probability, RNG &rng) |
| | RNG-driven wrapper: each gene flips independently with probability mutation_probability.
|
| |
| std::vector< double > | GaussianMutationByNoise (const std::vector< double > &genotype, const std::vector< double > &noise, const std::vector< bool > &apply_mask) |
| | Adds noise[i] to genotype[i] wherever apply_mask[i] is true, leaves the rest unchanged.
|
| |
| template<typename RNG > |
| std::vector< double > | GaussianMutation (const std::vector< double > &genotype, double sigma, double mutation_probability, RNG &rng) |
| | RNG-driven wrapper: each gene independently receives N(0, sigma^2) noise with probability mutation_probability.
|
| |
| double | PolynomialMutationByDraw (double x, double lower, double upper, double eta, double u) |
| | Polynomial-mutates a single bounded gene given an explicit draw.
|
| |
| template<typename RNG > |
| std::vector< double > | PolynomialMutation (const std::vector< double > &genotype, const std::vector< double > &lower_bounds, const std::vector< double > &upper_bounds, double eta, double mutation_probability, RNG &rng) |
| | RNG-driven wrapper: each gene independently mutates (via PolynomialMutationByDraw) with probability mutation_probability.
|
| |
| std::vector< int > | AllocateOffspringCounts (const std::vector< double > &species_adjusted_fitness_sums, int population_size) |
| | Pure core: allocates population_size offspring slots across species proportionally to each species' own adjusted-fitness sum, using the largest-remainder (Hamilton) apportionment method so the total always sums to exactly population_size (ties in fractional remainder broken by species index, earliest first). Falls back to an equal split (remainder to the earliest species, by index) if every species sum is non-positive, rather than dividing by zero.
|
| |
| template<typename RNG > |
| NEATGenome | ReproduceOffspring (const NEATGenome &parent, InnovationTracker &tracker, RNG &rng, double weight_mutation_sigma, double weight_mutation_probability, double add_connection_probability, double add_node_probability) |
| | RNG-driven wrapper: clones parent, then applies weight mutation (gated per-connection by weight_mutation_probability inside MutateWeights itself) and, independently, one attempt each at the two structural mutations, each gated by its own probability.
|
| |
| template<typename FitnessFn , typename RNG > |
| NEATEvolutionResult | RunNEATEvolution (std::vector< NEATGenome > population, FitnessFn fitness_fn, int num_generations, double compatibility_threshold, double c1, double c2, double c3, double weight_mutation_sigma, double weight_mutation_probability, double add_connection_probability, double add_node_probability, InnovationTracker &tracker, RNG &rng) |
| | Runs num_generations of speciated, mutation-only NEAT evolution. Each generation: evaluates every genome's fitness via fitness_fn, tracks the best genome seen across the whole run so far (global elitism – best_fitness never decreases generation to generation), speciates the population, applies fitness sharing, allocates each species a share of the next generation proportional to its adjusted-fitness sum, and fills that share with one unmutated species-champion copy plus mutated copies of uniformly-randomly chosen species members.
|
| |
| std::vector< double > | EvaluateNEATPhenotype (const NEATGenome &genome, const std::vector< double > &inputs) |
| | Evaluates genome's phenotype forward pass on inputs (one value per Input node, ordered by ascending node ID; the Bias node, if present, is always implicitly 1.0 and is not part of inputs).
|
| |
| double | CompatibilityDistance (const NEATGenome &a, const NEATGenome &b, double c1, double c2, double c3) |
| | Compatibility distance: delta = c1*E/N + c2*D/N + c3*W_bar, where E is the count of excess genes (innovation numbers beyond the other genome's own highest), D is the count of disjoint genes (innovation numbers within the overlapping range but present in only one genome), N is the larger genome's gene count (or 1 if both genomes have fewer than 20 connection genes – the original paper's own small-genome exception), and W_bar is the average weight difference over genes with matching innovation numbers (present in both genomes, regardless of enabled/disabled status).
|
| |
| SpeciesAssignment | SpeciatePopulation (const std::vector< NEATGenome > &population, double compatibility_threshold, double c1, double c2, double c3) |
| | Groups population into species: each genome joins the first existing species whose representative (that species' own first member) it is compatible with (distance < compatibility_threshold); otherwise it founds a new species with itself as representative.
|
| |
| std::vector< double > | ComputeAdjustedFitness (const std::vector< double > &raw_fitness, const std::vector< std::vector< size_t > > &species) |
| | Fitness sharing: each individual's adjusted fitness is its own raw fitness divided by the size of its species – protects small, structurally novel species from being immediately out-competed by a large, already-optimized one.
|
| |
| double | XORFitness (const NEATGenome &genome) |
| | Evaluates genome's phenotype on all four XOR patterns ((0,0)->0, (0,1)->1, (1,0)->1, (1,1)->0, in that order) and scores it as 4.0 minus the sum of squared errors – a perfect fit scores 4.0; a genome producing exactly 0.5 for every pattern (e.g. a fresh, all-zero-weight genome, before any weight differentiation has emerged) scores exactly 3.0 (4.0 - 4*0.25).
|
| |
| bool | Dominates (const Objectives &a, const Objectives &b) |
| | Pareto dominance (maximization convention): a dominates b iff a[i] >= b[i] for every objective i, and a[i] > b[i] for at least one objective.
|
| |
| std::vector< std::vector< size_t > > | FastNonDominatedSort (const std::vector< Objectives > &objectives) |
| | Fast non-dominated sort (Deb et al. 2002, Algorithm: fast-non-dominated-sort): partitions [0, objectives.size()) into fronts – front 0 is the non-dominated set, front 1 is non-dominated after removing front 0, and so on.
|
| |
| std::vector< double > | CrowdingDistance (const std::vector< Objectives > &front_objectives) |
| | Crowding distance within a single front.
|
| |
| template<typename Genotype > |
| std::vector< Individual< Genotype, Objectives > > | NSGA2Replacement (const std::vector< Individual< Genotype, Objectives > > &population, std::vector< Individual< Genotype, Objectives > > offspring, size_t mu) |
| | NSGA-II survivor selection: combines population and offspring, fast-non-dominated- sorts the pool, includes whole fronts (best first) until the next front would overflow mu, then fills the remainder from that final front by crowding distance (largest first – more diverse/isolated solutions preferred).
|
| |
| PBTTruncationGroups | ComputeTruncationGroups (const std::vector< double > &metrics, double truncation_fraction) |
| | Pure core: identifies the bottom and top truncation_fraction of the population by metric (higher is better). Ties are broken by a stable sort on descending metric, so the earlier index among equal values sorts toward "top." At least one individual is always selected on each end, even if floor(size*fraction) would be 0.
|
| |
| Configuration | ExploreConfigurationGivenFactors (const Configuration &config, const SearchSpace &space, const std::map< std::string, double > &factors) |
| | Pure core: applies an explicit per-parameter multiplicative factor to every Continuous/LogUniform/Integer parameter in config, clamped to that parameter's own bounds – PBT's own "explore" step (Jaderberg et al.'s own simple perturbation: multiply by 0.8 or 1.2). Categorical parameters are left unchanged (explore, in its original form, perturbs numeric hyperparameters only – a deliberate, logged scope decision, not an oversight). Integer results are rounded to the nearest integer.
|
| |
| template<typename RNG > |
| Configuration | ExploreConfiguration (const Configuration &config, const SearchSpace &space, RNG &rng) |
| | RNG-driven wrapper: draws each non-categorical parameter's factor uniformly from {0.8, 1.2} (Jaderberg et al.'s own standard explore perturbation), then applies ExploreConfigurationGivenFactors.
|
| |
| template<typename RNG > |
| std::vector< double > | RunPBTGeneration (std::vector< std::unique_ptr< PBTResumableTrial > > &trials, const SearchSpace &space, int num_epochs, double truncation_fraction, RNG &rng) |
| | Runs one PBT generation: trains every live trial for num_epochs, then exploits+explores the bottom truncation_fraction of the population from a uniformly-randomly-chosen member of the top truncation_fraction. Individuals outside both groups are left running untouched. Returns each trial's metric as of this generation (post exploit/explore for any trial that was replaced) – the value to feed into the next generation's own truncation.
|
| |
| template<typename RNG > |
| PBTResult | RunPBT (std::vector< std::unique_ptr< PBTResumableTrial > > &trials, const SearchSpace &space, int num_generations, int epochs_per_generation, double truncation_fraction, RNG &rng) |
| | Runs num_generations of RunPBTGeneration in sequence.
|
| |
| void | PolyakUpdate (Module &source, Module &destination, float tau) |
| | Soft target-network update (Lillicrap et al. 2016 / Haarnoja et al. 2018): destination_param[i] = tau * source_param[i] + (1 - tau) * destination_param[i], element-wise and in place.
|
| |
| std::vector< uint8_t > | SerializeSafetensors (const std::vector< std::pair< std::string, const Tensor * > > &tensors, const std::map< std::string, std::string > &metadata={}) |
| | Serializes tensors (as F32) and string metadata into safetensors bytes.
|
| |
| void | WriteSafetensors (const std::string &path, const std::vector< std::pair< std::string, const Tensor * > > &tensors, const std::map< std::string, std::string > &metadata={}) |
| | SerializeSafetensors() written to path.
|
| |
| template<typename Genotype , typename FitnessT , typename RNG > |
| size_t | TournamentSelect (const std::vector< Individual< Genotype, FitnessT > > &population, size_t tournament_size, RNG &rng) |
| | Tournament selection: draw tournament_size individuals without replacement from population and return the index of the fittest among them.
|
| |
| template<typename Genotype , typename FitnessT > |
| size_t | RouletteSelectByDraw (const std::vector< Individual< Genotype, FitnessT > > &population, FitnessT draw) |
| | Fitness-proportionate ("roulette wheel") selection given an explicit draw in [0, total_fitness). Pure and deterministic – the hand-testable core RouletteSelect wraps with an RNG-generated draw.
|
| |
| template<typename Genotype , typename FitnessT , typename RNG > |
| size_t | RouletteSelect (const std::vector< Individual< Genotype, FitnessT > > &population, RNG &rng) |
| | RNG-driven wrapper around RouletteSelectByDraw: draws uniformly from [0, total_fitness) and selects accordingly.
|
| |
| template<typename Genotype , typename FitnessT > |
| size_t | RankSelectByDraw (const std::vector< Individual< Genotype, FitnessT > > &population, double draw) |
| | Linear-rank selection given an explicit draw in [0, total_weight). Individuals are ranked ascending by fitness (worst = rank 1, best = rank population.size()); each rank's selection weight equals its rank, so the best individual is population.size() times as likely to be drawn as the worst. Pure and deterministic – the hand-testable core RankSelect wraps with an RNG-generated draw.
|
| |
| template<typename Genotype , typename FitnessT , typename RNG > |
| size_t | RankSelect (const std::vector< Individual< Genotype, FitnessT > > &population, RNG &rng) |
| | RNG-driven wrapper around RankSelectByDraw: draws uniformly from [0, total_weight) and selects accordingly.
|
| |
| Tensor | SinusoidalTimestepEmbedding (int64_t t, int64_t embedding_dim, DeviceBackend *backend, float base=10000.0f) |
| | Standard Transformer-style sinusoidal encoding of a diffusion timestep t: emb[2i] = sin(t / base^(2i/embedding_dim)), emb[2i+1] = cos(t / base^(2i/embedding_dim)) for i in [0, embedding_dim/2).
|
| |
| SuccessiveHalvingResult | RunSuccessiveHalvingOnConfigs (std::vector< Configuration > configs, const TrialFactory &make_trial, int initial_epoch_budget, double eta) |
| | Runs Successive Halving over an explicit, caller-supplied list of configurations – the pure, deterministic core; RunSuccessiveHalving (below) is the thin SearchSpace/RNG-sampling wrapper around it.
|
| |
| template<typename RNG > |
| SuccessiveHalvingResult | RunSuccessiveHalving (const SearchSpace &space, const TrialFactory &make_trial, size_t num_configs, int initial_epoch_budget, double eta, RNG &rng) |
| | RNG-driven wrapper: draws num_configs configurations from space via RandomSample, then runs RunSuccessiveHalvingOnConfigs.
|
| |
| template<typename Genotype , typename FitnessT > |
| std::vector< Individual< Genotype, FitnessT > > | GenerationalReplacement (const std::vector< Individual< Genotype, FitnessT > > &, std::vector< Individual< Genotype, FitnessT > > offspring, size_t mu) |
| | Generational replacement (DEAP's eaSimple): the offspring pool becomes the entire next generation; population is ignored (parents never survive).
|
| |
| template<typename Genotype , typename FitnessT > |
| std::vector< Individual< Genotype, FitnessT > > | MuPlusLambdaReplacement (const std::vector< Individual< Genotype, FitnessT > > &population, std::vector< Individual< Genotype, FitnessT > > offspring, size_t mu) |
| | (mu+lambda) replacement: the next generation is the fittest mu individuals from population union offspring (parents may survive) – more exploitative than (mu,lambda), since a fit parent is never discarded just for being old.
|
| |
| template<typename Genotype , typename FitnessT > |
| std::vector< Individual< Genotype, FitnessT > > | MuCommaLambdaReplacement (const std::vector< Individual< Genotype, FitnessT > > &, std::vector< Individual< Genotype, FitnessT > > offspring, size_t mu) |
| | (mu,lambda) replacement: the next generation is the fittest mu individuals from offspring only (population/parents are always discarded) – more explorative than (mu+lambda), since it cannot get stuck re-selecting the same elite parent forever.
|
| |
| std::string | format_iso8601_utc (std::chrono::system_clock::time_point tp) |
| | Formats tp as ISO-8601 UTC with milliseconds, e.g. "2026-10-02T12:34:56.789Z".
|
| |
| std::string | sample_to_json (const SystemSample &sample) |
| | Encodes sample as one JSON object (no trailing newline), the JSON Lines log record.
|
| |
| void | require_device (const Tensor &t, DeviceType expected, const char *where) |
| | Throws unless t lives on expected – the check every module and loss runs on the tensors handed to it (roadmap FND-8, gpu_review #1).
|
| |
| CollateFn | PadCollate (float pad_index=0.0f) |
| | Builds a CollateFn that right-pads variable-length token sequences (sample.fields[0], shape (1, seq_len) – TextDataset::get()'s output) to the batch's own max length, producing one (N, max_len) Tensor, plus a (N,) length field recording each sample's real (pre-padding) length. This is the CollateFn extension point Phase 1's architecture design reserved for ragged/variable-length modalities (PyTorch's collate_fn equivalent) – exercised here for the first time, with zero changes needed to Dataset/DataLoader/Batch themselves.
|
| |
| TopKResult | top_k (const Tensor &input, int64_t k, bool largest=true) |
| | Selects the k largest (or smallest) entries of every row along the last dimension.
|
| |
| double | GaussianKdeDensity (const std::vector< double > &observations, double bandwidth, double x) |
| | Fixed-bandwidth Gaussian KDE: density(x) = mean over every observation o of N(x; o, bandwidth^2).
|
| |
| double | CategoricalDensity (const std::vector< std::string > &observations, size_t num_categories, const std::string &category) |
| | Laplace(add-one)-smoothed empirical probability of category among observations.
|
| |
| double | LogDensityRatio (const SearchSpace &space, const Configuration &candidate, const std::vector< Configuration > &good_configs, const std::vector< Configuration > &bad_configs) |
| | log(l(candidate)) - log(g(candidate)): the TPE scoring function, summed independently over every parameter in space (so a candidate's mixed continuous/categorical parameters each contribute their own term, composing naturally rather than needing a joint density over the whole space).
|
| |
| template<typename ObjectiveFn , typename RNG > |
| std::vector< Trial > | RunTPELoop (const SearchSpace &space, ObjectiveFn objective_fn, size_t num_initial_random, size_t num_iterations, double gamma, size_t num_candidates, RNG &rng) |
| | Runs TPE: num_initial_random uniformly-random trials (RandomSample), then num_iterations trials each chosen by splitting all trials so far into good/bad by the gamma quantile (maximization convention: good = highest objective values) and picking, among num_candidates uniformly-random candidates, the one maximizing LogDensityRatio.
|
| |
| float | NormalizeUnsigned (float value, float max_abs) |
| | Normalizes value into [0, 1] against a known maximum magnitude, for unsigned (magnitude-only) quantities such as saliency intensity or ablation effect.
|
| |
| float | NormalizeSigned (float value, float max_abs) |
| | Normalizes value into [-1, 1] against a known maximum absolute magnitude, for signed quantities such as attribution direction (positive/negative contribution).
|
| |
| RgbColor | ViridisColormap (float normalized_value) |
| | Viridis colormap – perceptually uniform, colorblind-safe – for sequential/unsigned magnitude (hc_information_visualization.md SS4: "Recommended Color Systems").
|
| |
| RgbColor | DivergingColormap (float signed_normalized_value) |
| | Blue-White-Red diverging colormap for signed attribution (positive/negative contribution) – hue encodes direction only, never magnitude (hc_information_visualization.md SS1's Cleveland-McGill rule: color hue is categorical/directional, magnitude must be position or length).
|
| |
| BarSeries | ToFeatureImportanceBars (const Attribution &attr, int top_k) |
| | Converts an Attribution's per-feature values into labeled, magnitude-sorted bars for a horizontal bar chart – the canonical XAI feature-importance encoding (hc_information_visualization.md SS5: position on a shared axis, Cleveland-McGill rank 1).
|
| |
| std::vector< WaterfallStep > | ToWaterfallSteps (const Attribution &attr, float baseline_value) |
| | Converts an Attribution's per-feature values into a cascading waterfall from a real baseline to the final prediction (hc_information_visualization.md SS5/SS6: the one case where a bar chart legitimately does not start at zero, since the baseline itself is the meaningful reference point – Tufte's lie-factor rule is satisfied relative to that baseline, not to zero).
|
| |
| std::vector< WaterfallBar > | ToWaterfallBars (const std::vector< WaterfallStep > &steps, float baseline_value) |
| | Converts waterfall steps into floating bars, each spanning from the previous running total to its own running total – i.e. bar i covers [min(c_{i-1}, c_i), max(c_{i-1}, c_i)] with c_{-1} = baseline_value. Correct for any sign of baseline or running total: a cascade that starts below zero, crosses zero, or stays negative (e.g. explaining a negative logit) floats exactly where the running total is, rather than being anchored at zero the way stacked bar segments are.
|
| |
| HeatmapGrid | ToSaliencyHeatmap (const Attribution &attr) |
| | Reshapes an Attribution's values into a 2D grid for a saliency overlay heatmap.
|
| |
| HeatmapColorScale | ComputeHeatmapColorScale (const HeatmapGrid &grid) |
| | Chooses a heatmap's color scale from its values (hc_information_visualization.md SS4: sequential maps for unsigned magnitude, diverging maps centred on the meaningful midpoint – zero – for signed quantities).
|
| |
| std::vector< BeeswarmPoint > | ToBeeswarmPoints (const std::vector< Attribution > &runs, int64_t feature_index) |
| | Converts one feature's attribution value across many repeated/independent runs into jittered (x, y) points for a beeswarm plot – the global-explanation distribution view (hc_information_visualization.md SS5: "SHAP beeswarm plot...
each point is one prediction; x-position is the SHAP value"). Deterministic, density-based jitter: points are binned along x, then colliding points within a bin are alternately offset above/below y=0 so they read as spread rather than overlapping – not a random jitter, so two calls with the same input always produce the same layout.
|
| |
| std::string | CircuitNodeDisplayLabel (const CircuitNode &node) |
| | Human-readable label for a CircuitGraph node: the node's own label when it has one, otherwise its operation type and id (e.g. "Conv #1", "Activation #2") – so an unlabeled ComputationGraph still renders as a readable layer diagram rather than a row of anonymous "node_<id>" markers.
|
| |
| HistogramBins | ToFieldHistogramBins (const Dataset &dataset, int64_t field_index, int num_bins) |
| | Bins one Sample field's values (flattened across every sample's Tensor at that field position, mirroring DatasetValidator's aggregation convention) into num_bins equal-width bins, for a per-field distribution histogram (hc_information_visualization.md's data-preview touchpoint).
|
| |
| RgbImageBuffer | ToRgbImageBuffer (const Tensor &image_chw) |
| | Converts a decoded image Tensor into an interleaved-RGB byte buffer for GPU texture upload (the data-preview "image grid" touchpoint's pure half – the actual glTexImage2D call lives in TextureCache, which is GL-dependent and untestable here).
|
| |
| Vocabulary | BuildVocabulary (const std::vector< std::vector< std::string > > &tokenized_corpus, int64_t max_vocab_size=-1) |
| | Builds a Vocabulary from a tokenized corpus, ranked by descending token frequency (ties broken by first-seen order, for determinism).
|
| |
| std::vector< float > | fit_weighted_linear_regression (const std::vector< std::vector< float > > &samples, const std::vector< float > &targets, const std::vector< float > &weights, float l2_lambda) |
| | Fits w* = argmin_w sum_i weight_i*(target_i - w^T sample_i)^2 + l2_lambda*||w||^2 via the normal equations (X^T W X + l2_lambda*I) w = X^T W y.
|
| |