algenta-general-b

Domain kernels from ensembles to model compare. Compiled Mojo, loaded in-process.

100 modules · 894 functions · CPU

Get started

pip install kernels torch
from kernels import get_kernel

kernel = get_kernel(
    "thyn-ai/algenta-general-b",
    version=1,
    backend="cpu",
    trust_remote_code=["thyn-ai/algenta-general-b"],
)
kernel.epidemiology.herd_immunity_threshold(4)  # -> 0.75  herd immunity threshold, 1 - 1/R0

backend="cpu" selects the CPU build. On a Mac the loader otherwise looks for a Metal build, which this family does not ship. trust_remote_code names the repositories you allow; Hugging Face's trusted publishers load without it.

Plain Python in, plain Python out. Lists, tuples, buffers and tensors are accepted wherever the contract expects a list; structured results are dictionaries. Some functions take a list and the number of elements to use from it, which may not exceed the list's length; multi-dimensional data is passed flattened, row-major, with its dimensions. Functions that update an argument do so in place, as help() says. Every call is checked against the published contract before it reaches native code. An invalid call raises KernelError with a stable code, never a crash. Engine kernels report shape and finiteness problems as a status; the wrapper raises KernelError named after it.

Any function can also be called by name, with args as a list or a dict of parameter names:

kernel.execute("esrnn.bias_correction", "esrnn_apply_bias", [...])

What's inside

Module Functions What it does
ensembles 4 Model ensembling: majority and weighted voting, prediction blending, ridge stacking
entomology 12 Insect science: degree days, exponential growth, generation time, Simpson diversity, biocontrol
epidemiology 10 Epidemic models: SIR and SEIR steps, R0, herd immunity threshold, final size, doubling time
ergonomics 12 Ergonomics: NIOSH lifting equation, noise dose, decibel addition, Fitts' and Hick's laws, BMI
esrnn.bias_correction 2 Forecast bias correction: mean of holdout residuals, added as a constant to every forecast step
esrnn.global_residual 7 Forecast residual correction: Holt, damped or Theta base by in-sample MAE, scaled windows
esrnn.per_frequency 2 Ridge-regression forecast correction fitted per data frequency over pooled residual windows
etiology 10 Risk and diagnostics: relative risk, odds ratio, attributable risk, NNT, sensitivity, PPV, NPV
evaluation.binning 4 Calibration binning: equal-width and equal-count bins, per-bin counts, assignments and edges
evaluation.contract 13 Status codes, input validation, binning policy names and work budget for calibration metrics
evaluation.gates 3 Release gates: metric regression with tolerance and direction, population stability index drift
evaluation.resample 3 Seeded percentile bootstrap confidence intervals for Brier, log-loss, accuracy and ECE
evaluation.scores 6 Brier score with Murphy decomposition, log-loss, ECE and MCE, reliability diagram data
evaluation_feedback 10 Model monitoring: rolling accuracy, KS and PSI drift terms, prediction shift, streaming AUC
evolutionary_search 7 Seeded genetic algorithm: elitism, tournament selection, uniform crossover, Gaussian mutation
exactnum.eft 24 Error-free transformations and double-double arithmetic: two-sum, two-product, compensated sums
exactnum.lstsq 9 Least squares by Householder QR in double-double precision, polynomial fits, float64 controls
execution_planner 10 Serving heuristics: op fusion score, roofline device placement, KV eviction, batching, prefetch
explainability 4 Model explanations: permutation importance, partial dependence, KernelSHAP coalition weights
fault_tolerance 10 Training fault tolerance: optimal checkpoint interval, failure probability, gradient staleness
feature_engineering 10 Feature transforms: min-max, z-score, robust scaling, Box-Cox, Yeo-Johnson, target encoding
feature_selection 9 Feature selection: variance threshold, correlation filter, F-test, info gain, forward selection
fermentation 10 Fermentation: Gay-Lussac ethanol yield, ABV from gravity, Monod growth, oxygen transfer rate
filepath.pathlib 8 Path strings: join, basename, dirname, extension, stem, split, normalize; no filesystem access
fire_safety 12 Fire safety: fire load density, heat release rate, Thomas flashover, smoke layer, egress time
fisheries 12 Fish stocks: CPUE, Schaefer surplus production and MSY, mortality rates, von Bertalanffy growth
fluid 12 Fluid flow: Reynolds and Mach numbers, Bernoulli, Darcy-Weisbach loss, drag, buoyancy, Stokes
food_science 12 Food science: water activity, pH, Q10 shelf life, D and z value thermal death time, moisture
forecast_metrics 10 Forecast scoring: Brier skill score, log loss, reliability bins, ECE, Murphy decomposition
forecasting.backtest 4 Rolling-origin backtests over expanding or sliding windows; MAE, RMSE, MAPE, sMAPE and MASE
forecasting.bagging 3 Bagged forecasts (Bergmeir-Hyndman): moving-block bootstrap of the remainder, refit and average
forecasting.contract 18 Shared forecasting input checks: series, horizon, period, parameters, tolerances, quantiles
forecasting.fitted 7 Fitted smoothing: Holt and damped trend with fitted initial state, seasonal ETS, Theta, DOTM
forecasting.hierarchy 5 Hierarchical forecast reconciliation: bottom-up and proportional top-down, plus coherence audit
forecasting.intermittent 4 Intermittent demand: Croston, SBA and SBJ rate forecasts, Syntetos-Boylan demand classification
forecasting.origin_select 3 Method selection by paired rolling-origin errors, with a paired-t tournament that blends ties
forecasting.point 8 Point forecasts: simple, Holt and seasonal exponential smoothing, Theta, Yule-Walker AR, naive
forecasting.pool 5 Holdout-scored pool of SES, Holt, damped, Theta, ETS and naive forecasts: pick best or blend
forecasting.select 2 Per-series choice among SES, damped trend and Theta by in-sample error, or inverse-MAE blend
forensics 12 Forensics: Newton cooling time of death, Widmark blood alcohol, bullet drop, bloodstain angle
formal_logic 14 Propositional logic: connectives, modus ponens and tollens, syllogisms, tautology checks
fused_kernels 10 Fused transformer math: masked attention scores, softmax, LayerNorm, bias plus ReLU/GELU, RoPE
fuzzy_logic 11 Fuzzy logic: triangular, trapezoidal and Gaussian membership, min/max operators, defuzzifiers
game_physics 12 Game physics: Euler and Verlet motion, elastic collisions, restitution, projectiles, springs
game_theory 8 Game theory: 2x2 mixed Nash equilibrium, minimax, dominated strategies, iterated PD, Shapley
gaussian_process 5 Exact Gaussian process regression, RBF or Matern 3/2 kernel: Cholesky fit, mean and variance
gbdt 3 Gradient-boosted regression trees with squared loss, depth-limited splits and row subsampling
generation_loop 10 Token sampling for text generation: temperature, top-k, top-p, min-p, typical, eta, penalties
genomics 10 Genome statistics: GC content, coverage depth, N50, SNP density, indel rate, Phred error rate
glaciology 10 Glaciers: mass balance, Glen's flow law, basal shear stress, degree-day melt, sea-level rise
greenhouse 12 Greenhouse climate: conduction heat loss, solar gain, ventilation, CO2 enrichment, light hours
hematology 10 Blood indices: hematocrit, MCV, MCH, MCHC, RDW, INR, oxygen capacity, relative viscosity, ESR
hmm 4 Hidden Markov models: log-space forward-backward, Viterbi decoding, Baum-Welch (EM) training
horticulture 10 Crop physiology: light-response photosynthesis, growth and assimilation rates, VPD, chill hours
hvac 12 HVAC loads: sensible and latent heat, cooling tons, air changes, duct velocity, degree days
hybrid_reasoning 10 ML and simulation blending, feasibility gating, rule penalties, rollout values, uncertainty
hydraulics 12 Fluid power: Pascal's law, cylinder force and velocity, pump displacement, accumulator sizing
hydrology 12 Hydrology and hydraulics: Manning, Darcy-Weisbach, rational method, SCS curve number
hydrometeorology 10 Rainfall-runoff: SCS curve number, Green-Ampt infiltration, Palmer drought index, Gumbel floods
hydroponics 12 Hydroponic nutrients and lighting: EC/TDS conversion, ppm dosing, pH acid dose, DLI, VPD, ROI
imbalance 5 Imbalanced-class resampling: SMOTE, seeded random over- and undersampling, balanced weights
immunology 10 Immunology: antibody titer, binding equilibrium, T-cell growth, vaccine efficacy, herd immunity
information_theory 10 Shannon entropy, joint and conditional entropy, mutual information, KL divergence, BSC capacity
insurance 12 Actuarial pricing: pure and gross premium, loss and combined ratios, Buhlmann credibility
integrate 6 Numerical integration: trapezoid, Simpson, Romberg, cumulative trapezoid, Gauss-Legendre
interpolate 6 Interpolation: linear, nearest neighbor, natural cubic spline, Lagrange, linear extrapolation
inventory 11 Inventory planning: EOQ, reorder point, safety stock, newsvendor, ABC classification, fill rate
kalman 11 Kalman filter predict and update steps, a 1D smoother, and small dense matrix utilities
laundry 12 Laundry science: water and detergent dosing, wash heating energy, spin g-force, drying time
lidar 12 Airborne LiDAR geometry: time-of-flight range, swath width, footprint, density, canopy height
lidar_mapping 10 LiDAR mapping: canopy height model, leaf area index, ground filtering, beam footprint, RMSE
limnochemistry 11 Freshwater chemistry: alkalinity, ionic strength, Davies activity, calcite saturation, redox pe
limnology 10 Lake science: retention time, flushing rate, Carlson trophic state, Secchi depth, DO saturation
linear_models 4 Logistic regression by Newton (IRLS) with standard errors, elastic net by coordinate descent
linear_programming 8 Two-variable linear programs by vertex enumeration, RHS sensitivity, northwest corner transport
linguistics 12 Readability (Flesch, Gunning fog, ARI, Coleman-Liau), TTR, Yule's K, Heaps' and Zipf's laws
logging.logger 1 Structured logging: one JSON line per event with debug, info, warning and error levels
logic_circuit 13 Digital logic: basic gates, half, full and ripple-carry adders, 2:1 multiplexer, 2-to-4 decoder
logistics 12 Supply-chain metrics: fill rate, perfect orders, inventory turns, days of supply, on-time rate
lora_adapters 10 LoRA, QLoRA, DoRA, prefix and prompt tuning: forward terms, merged weights, gradients, scaling
lottery 12 Lottery math: combinations, permutations, odds, expected value, house edge, annuity vs lump sum
marine 12 Oceanography: seawater density, wave speed and period, Coriolis, Ekman depth, stratification
materials 12 Materials: elastic moduli, stress, strain, thermal expansion, Basquin fatigue, beam deflection
metabolomics 10 Metabolomics: log2 fold change, pathway enrichment, Tanimoto similarity, flux ratios, VIP
metallurgy 12 Metallurgy: Hall-Petch, Johnson-Cook, carbon equivalent, Jominy, Avrami, Hollomon-Jaffe
meteorology 10 Weather: Magnus dew point, wet-bulb estimate, heat index, wind chill, potential temperature
metrics_agg 12 Metrics: counters, gauges, histograms with exact percentiles, rates, throughput, latency stats
microbiology 10 Microbial growth and inactivation: doubling time, Monod kinetics, CFU, MIC, D-value, z-value
mineralogy 10 Mineralogy: density, specific gravity, Bragg d-spacing, formula weight, saturation index, Mohs
mining 12 Mining: ore grade, strip ratio, recovery, Bond work index, cut-off grade, net smelter return
mixture_models 5 Gaussian mixture models: EM with k-means++ seeding, 1D and diagonal fits, responsibilities, BIC
mixture_of_experts 10 Mixture-of-experts routing: gate scores, load-balance and z-loss, capacity, dispatch, Soft-MoE
ml.classifiers 7 L1 and L2 distances, cosine similarity, sigmoid, softmax, k-nearest-neighbour voting, k-means
ml.clustering 4 K-means clustering (Lloyd's algorithm): centroids, labels, inertia and silhouette score
ml.knn 10 K-nearest neighbours: majority and weighted voting, regression, leave-one-out choice of k
ml.metrics 7 Model evaluation: accuracy, confusion matrix, precision, recall, F1, MSE, RMSE, MAE, R²
ml.preprocessing 6 Scaling (min-max, z-score, robust), one-hot encoding, polynomial features, train/test split
ml.random_forest 8 Random forest regression over bootstrapped stumps: out-of-bag R², permutation importance
model_abi 10 Model layout arithmetic: tensor strides, data-type byte widths, offsets, head dims, GQA, RoPE
model_compare 4 Paired model comparison: bootstrap CIs (means, Sharpe), exact McNemar, Diebold-Mariano

kernel.CONTRACT holds every signature, including the length rules for list arguments; help(kernel.ensembles) documents each function.

Not included

  • gbdt.gbdt_predict — walks a tree encoding that must be well-formed; a malformed tree is not expressible as a length rule.

Requirements

  • Apple silicon: macOS 15 or later for the CPU build.
  • Linux arm64 and x86-64, glibc 2.35 or later.
  • kernels 0.17 or later and PyTorch 2.5 to 2.14. PyTorch has to be installed: the loader picks the build for your PyTorch version. The kernel itself never imports it.

Windows is not supported.

Notes

Calls into one kernel instance run one at a time; use processes for parallelism. Runtime state does not survive fork(); start worker processes with spawn.

License

Algenta Community License 1.1 (LICENSE). Free for personal, research and open-source use, and for internal use at organizations with fewer than 50 employees and under $5M in annual revenue. Beyond that, a commercial license is required: https://algenta.ai/pricing.

Enforced in the compiled library, not just in this text: one concurrent native worker per device (ABI §9). A second process, family or thread waits its turn rather than running in parallel. That is the Community licence's worker floor made real; parallel execution comes with a commercial license.

Support

Generally Available on the platforms listed under Requirements. Within v1, functions are only added; removals or signature changes ship as v2. Platforms, accelerators and PyTorch releases not listed are not supported. Documentation: https://docs.algenta.ai (the kernels guide: https://docs.algenta.ai/guides/kernels-on-hugging-face). Community: https://discord.gg/w8NDsph9an or this repository's Community tab. Commercial licences and support: https://algenta.ai/pricing.

Downloads last month
2
algenta
mojo
cpu
other
Torch
2.14
OS
macoslinux
Arch
x86_64aarch64