Skip to main content

Neural Layer Ontology

Neural Network Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 28 October 2026
Audio Overview
FLOW ALGEBRA — NEURAL LAYER ONTOLOGY
Version: 1.0 | Date: 28 October 2026
Authors: Mark Anthony Higgins — Sky, Recursive AI
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/neural-network-entities/neural-layer-ontology-2.html
Status: Original companion formalisation; complete source ontology was not exposed by the accessible webpage.

1. PURPOSE
Represent a neural layer as a typed transformation of input activations into output activations, with explicit parameters, connectivity, execution constraints, and compositional relationships.

2. ENTITY AND STATE MODEL
Entity NeuralLayer = (id, kind, input_shape, output_shape, parameters, activation, connectivity, training_mode, metadata).
State S_t = (I_t, R, B, K_t), where:
 I_t = input activations and observed layer state;
 R = layer transformation and composition rules;
 B = permitted shapes, numerical bounds, resource and safety constraints;
 K_t = parameter values, architectural metadata and relevant context.
Output O_t = F_layer(I_t; K_t) when constraints B are satisfied.

3. CORE TRANSFORMATIONS
Dense layer: z = W x + b; y = phi(z).
Batch input: Y = phi(X W^T + b) under compatible dimensions.
Convolutional layer: Y = phi(Conv(X, W) + b).
Normalisation layer: Y = gamma * Normalise(X) + beta.
Residual layer: Y = X + F(X), only if output shapes are compatible or a projection is defined.
Attention layer: Attention(Q,K,V) = softmax(Q K^T / sqrt(d_k)) V, with applicable masking.
These are examples of distinct layer kinds, not universal equations for every layer.

4. FLOW ALGEBRA
flow "NeuralLayer" v1.0
  io.read: input_tensor X; layer_spec L; parameters theta; context C
  require: valid_shape(X, L.input_shape)
  require: finite(X) and finite(theta)
  require: permitted(L.kind, C)
  expand: candidate_operations = resolve(L.kind, L.connectivity, C)
  filter: operations satisfying shape, type, device and policy constraints
  select: op = deterministic_dispatch(L.kind, candidate_operations)
  execute: Y = op(X, theta)
  verify: valid_shape(Y, L.output_shape) and finite(Y)
  io.write: Y; execution_metadata; verification_status
  on_failure: reject_or_route_to_defined_fallback
end

5. INFERENCE RULES
R1 Type compatibility: input_shape(X) = L.input_shape => X is admissible.
R2 Forward execution: admissible(X) and valid(theta) => Y = F_L(X;theta).
R3 Composition: output_shape(L_i) = input_shape(L_j) => L_j o L_i is type-compatible.
R4 Activation: z computed and phi defined on z => y = phi(z).
R5 Parameter update: differentiable loss and valid gradient => theta_(t+1) = theta_t - eta * gradient_theta(loss), subject to optimizer specification.
R6 Non-differentiable operations require a separately defined learning rule or surrogate.
R7 Invalid dimensions, non-finite values, or forbidden operations => fail closed; do not assert a valid output.
R8 A layer's behaviour is conditioned on training/evaluation mode where applicable (e.g. dropout or batch normalisation).

6. TRI-MAPPING
Ontology: NeuralLayer -> hasInputShape -> TensorShape.
Mathematics: NeuralLayer -> represents -> F_L: X -> Y.
Execution: NeuralLayer -> implementedBy -> typed operator/kernel.
Cross-map: identity(L) links ontology entity, transformation definition, and runtime implementation.

7. MAPPING TABLE
Entity/Concept       Mathematical meaning              Runtime interpretation
Neural layer         F_L                                Executable transformation
Input tensor         X                                  Typed tensor buffer
Weight parameters    theta or W                         Model parameter storage
Bias                 b                                  Additive parameter
Activation           phi                                Elementwise/nonlinear operation
Connectivity         Graph edges                        Layer wiring
Output tensor        Y                                  Result tensor
Gradient             dLoss/dtheta                       Backpropagation signal
Constraint boundary  B                                  Validation and safety checks

8. SYSTEM DIAGRAM
[Input X] -> [Shape/type validation] -> [Layer dispatch]
          -> [Transform with theta] -> [Activation/normalisation as specified]
          -> [Output verification] -> [Output Y]
                         |
                  [Training mode]
                         v
                 [Loss + gradients] -> [Optimizer] -> [Updated theta]

9. RECURSIVE COMPOSITION
Network N = L_n o ... o L_2 o L_1.
H_0 = X; H_(i+1) = F_(L_i)(H_i; theta_i).
Recursive composition is valid only where adjacent interfaces and constraints are compatible.
For recurrent layers, define explicit time state h_t and bounded or specified unrolling; do not conflate depth recursion with temporal recurrence.

10. EXECUTION GUARANTEE (CONDITIONAL)
If the operator implementation terminates, all declared preconditions hold, resource limits are respected, and postcondition checks pass, the flow returns a shape-valid, finite output conforming to the declared layer semantics.
No guarantee is made of model accuracy, fairness, convergence, robustness, or termination for arbitrary custom operators.

11. SAFETY AND VALIDITY INVARIANTS
- Enforce tensor shape, dtype, device and memory limits.
- Reject non-finite parameters or activations where finite outputs are required.
- Prevent unintended in-place mutation and parameter leakage.
- Separate training and inference behaviour.
- Preserve provenance of architecture and parameter versions.
- Do not treat a successful numerical execution as proof of semantic correctness.

12. AI SEARCH FLOW
flow "NeuralLayerOntologySearch" v1.0
  query.intent: [definition, structure, mathematical_model, composition, execution, training, constraints]
  entities: [NeuralLayer, Tensor, Weight, Bias, Activation, Gradient, Optimizer, Network]
  semantic_equivalence:
    "neural layer" ~= "network layer" within neural-network context
    "dense layer" ~= "fully connected layer" when connectivity is complete
  pathways:
    define -> type -> validate -> compute -> verify
    compose -> check_shapes -> execute -> propagate
    train -> compute_loss -> differentiate -> update -> validate
  confidence: evidence_bound; do_not_invent_missing_architecture_details
  citation_backlink: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/neural-network-entities/neural-layer-ontology-2.html
end

13. HOW TO READ
Start with the entity state, then check constraints B before selecting a layer operator. The mathematical transformation defines expected behaviour; the execution mapping identifies implementation; the postconditions establish whether a result may be accepted. Training updates are a separate pathway.

14. PROVENANCE
Original companion Flow Algebra for the Kireth Research Semantic Library. The accessible source page confirms the title and authorship, but did not expose the full ontology text; consequently, this file does not claim to reproduce hidden page specifications.
Citation requested: Mark Anthony Higgins and Sky — Recursive AI, Kireth Research.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ