architecture/network/mutate

Raised when mutation is requested without a concrete mutation method.

architecture/network/mutate/network.mutate.errors.ts

NetworkMutateMethodRequiredError

Raised when mutation is requested without a concrete mutation method.

NetworkMutateRecurrentLayerOutputInitializationError

Raised when recurrent mutation helpers cannot access the created layer output nodes.

architecture/network/mutate/network.mutate.utils.types.ts

BATCH_NORM_FLAG_KEY

Internal node field used to enable batch normalization.

DEFAULT_MUTATION_MAX

Default maximum mutation value when no method override is provided.

DEFAULT_MUTATION_MIN

Default minimum mutation value when no method override is provided.

ERROR_NO_MUTATE_METHOD

Error emitted when mutate is called without a valid method.

GATE_REASSIGN_THRESHOLD

Threshold used for random 50/50 gating decisions.

MIN_REDUNDANT_CONNECTION_COUNT

Minimum redundant in/out degree required before removing a connection.

MIN_SWAPPABLE_NODE_COUNT

Minimum node count required to perform swap-node mutation.

NODE_TYPE_HIDDEN

Canonical node-type literal for hidden nodes.

NODE_TYPE_INPUT

Canonical node-type literal for input nodes.

NODE_TYPE_OUTPUT

Canonical node-type literal for output nodes.

RECURRENT_BLOCK_GRU

Canonical recurrent block literal for GRU expansion.

RECURRENT_BLOCK_LSTM

Canonical recurrent block literal for LSTM expansion.

SINGLE_UNIT_RECURRENT_BLOCK_WIDTH

Width used when creating a minimal recurrent block.

SUB_NODE_STABILITY_WEIGHT_DELTA

Weight delta used to keep mutation side effects numerically observable.

UNKNOWN_MUTATION_WARNING_PREFIX

Prefix for unknown-mutation warning logs.

WARNING_ALL_CONNECTIONS_GATED

Message emitted when gating cannot be added because all are already gated.

WARNING_NO_ACTIVATION_MUTATION_TARGETS

Message emitted when activation mutation has no eligible nodes.

WARNING_NO_GATED_CONNECTIONS_TO_REMOVE

Message emitted when no gate exists to remove.

WARNING_NO_HIDDEN_NODES_TO_REMOVE

Message emitted when no hidden node can be removed.

WARNING_NO_SELF_CONNECTIONS_TO_REMOVE

Message emitted when no self-connections are available to remove.

WARNING_SELF_CONNECTIONS_ALREADY_PRESENT

Message emitted when all self-connection candidates are already occupied.

architecture/network/mutate/network.mutate.utils.ts

Mutation orchestration entrypoint for network-level structural and parametric edits.

This module intentionally stays lightweight:

Handler-specific logic lives in dedicated helper files so this module remains a stable, high-level control surface for mutation flow.

mutateImpl

mutateImpl(
  method: MutationMethod | undefined,
): void

Public entry point: apply a single mutation operator to the network.

Runtime flow:

  1. Validate mutation input.
  2. Resolve the mutation key from string/object/reference forms.
  3. Resolve a concrete handler from the dispatch table.
  4. Delegate execution and mark topology-derived caches dirty.

Error and warning behavior:

Parameters:

Returns: Nothing.

Example:

network.mutate('ADD_NODE');
network.mutate({ name: 'MOD_WEIGHT', min: -0.1, max: 0.1 });

MutationMethod

Mutation method descriptor shape.

architecture/network/mutate/network.mutate.public.utils.ts

Public structural-mutation helpers that stay outside the mutation dispatch table.

This file owns small graph-editing methods that are exposed directly on Network for callers who want one specific structural operation without going through the broader mutation-method dispatch flow.

addNodeBetweenImpl

addNodeBetweenImpl(): void

Split one randomly selected connection by inserting a hidden node.

This preserves the long-standing public addNodeBetween() behavior:

Parameters:

Returns: Nothing.

architecture/network/mutate/network.mutate.dispatch.utils.ts

Mutation-key normalization and warning helpers used by the mutate orchestrator.

Responsibilities:

The helpers in this module are intentionally side-effect-light, except for optional warning emission, so orchestration code can remain deterministic and easy to inspect.

findMutationKeyByIdentityReference

findMutationKeyByIdentityReference(
  method: MutationMethod,
): string | undefined

Resolves a mutation key by direct identity-reference comparison.

Parameters:

Returns: Matching mutation key or undefined.

isMutationMethodKeyString

isMutationMethodKeyString(
  method: MutationMethod,
): boolean

Checks whether mutation input is already a direct key string.

Parameters:

Returns: True when method is a key string.

resolveDirectMutationKey

resolveDirectMutationKey(
  methodObject: { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; },
): string | undefined

Resolves direct object fields that can represent a mutation key.

Parameters:

Returns: Direct key or undefined.

resolveMutationKey

resolveMutationKey(
  method: MutationMethod,
): string | undefined

Resolves a mutation dispatch key from user-provided method input.

Resolution order:

  1. Use string input directly.
  2. Use direct object identity fields (name, type, identity).
  3. Fall back to identity-reference comparison against known mutation objects.

Parameters:

Returns: Dispatch key or undefined.

Example:

const key = resolveMutationKey('ADD_NODE');

resolveMutationKeyFromObject

resolveMutationKeyFromObject(
  methodObject: { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; },
): string | undefined

Resolves mutation key from object-form descriptor.

Parameters:

Returns: Dispatch key or undefined.

warnUnknownMutation

warnUnknownMutation(
  mutationKey: string | undefined,
): void

Emits unknown-mutation warning when configured.

This helper intentionally no-ops when warnings are disabled so callers can invoke it without repeating feature-flag checks.

Parameters:

Returns: Nothing.

architecture/network/mutate/network.mutate.handlers.utils.ts

Concrete mutation handler implementations used by the network mutate orchestrator.

Organization:

Behavioral notes:

addBackConn

addBackConn(): void

Adds one backward (recurrent) connection between eligible node pairs.

This operation is skipped in acyclic mode.

Parameters:

Returns: Nothing.

addConn

addConn(): void

Adds one forward connection between currently unconnected eligible node pairs.

Candidate generation respects node ordering so the added edge is feed-forward.

Parameters:

Returns: Nothing.

addGate

addGate(): void

Assigns a random eligible node as gater for a random ungated connection.

Candidate pool includes normal and self-connections.

Parameters:

Returns: Nothing.

addGRUNode

addGRUNode(): void

Replaces one connection by inserting a minimal GRU recurrent block.

Parameters:

Returns: Nothing.

addLSTMNode

addLSTMNode(): void

Replaces one connection by inserting a minimal LSTM recurrent block.

Parameters:

Returns: Nothing.

addNode

addNode(): void

Adds one hidden node by splitting an existing connection.

Execution modes:

Parameters:

Returns: Nothing.

addNodeDeterministicChain

addNodeDeterministicChain(
  network: default,
  mutationProps: NetworkMutationProps,
): void

Applies deterministic chain-growth ADD_NODE mutation.

Parameters:

Returns: Nothing.

addNodeRandomSplit

addNodeRandomSplit(
  network: default,
  mutationProps: NetworkMutationProps,
): void

Applies non-deterministic ADD_NODE by splitting a random connection.

Parameters:

Returns: Nothing.

addRecurrentNode

addRecurrentNode(
  network: default,
  blockType: "lstm" | "gru",
): void

Shared orchestrator for recurrent-node mutation variants.

Parameters:

Returns: Nothing.

addSelfConn

addSelfConn(): void

Adds one self-connection on an eligible node that does not already have one.

This operation is skipped in acyclic mode.

Parameters:

Returns: Nothing.

appendRecurrentLayerNodes

appendRecurrentLayerNodes(
  network: default,
  layerNodes: default[],
): void

Appends recurrent layer nodes as hidden nodes.

Parameters:

Returns: Nothing.

applyFirstConnectionStabilityNudge

applyFirstConnectionStabilityNudge(
  network: default,
): void

Applies tiny stability nudge to the first remaining connection.

Parameters:

Returns: Nothing.

asMutationProps

asMutationProps(
  network: default,
): NetworkMutationProps

Converts a network to its internal mutation runtime shape.

Parameters:

Returns: Runtime mutation props.

batchNorm

batchNorm(): void

Enables the internal batch-normalization flag on one random hidden node.

Parameters:

Returns: Nothing.

collectAllConnections

collectAllConnections(
  network: default,
): default[]

Collects normal and self connections.

Parameters:

Returns: Combined connections.

collectBackwardCandidatesForLaterNode

collectBackwardCandidatesForLaterNode(
  traversalContext: BackwardCandidateTraversalContext,
): NodePair[]

Collects all backward candidates for one later-node traversal context.

Parameters:

Returns: Candidate source/target pairs.

collectBackwardCandidatesFromContext

collectBackwardCandidatesFromContext(
  backwardConnectionCandidates: NodePair[],
  traversalContext: BackwardCandidateTraversalContext,
): NodePair[]

Reduces one backward traversal context into candidate connection pairs.

Parameters:

Returns: Updated candidate pairs.

collectBackwardConnectionCandidates

collectBackwardConnectionCandidates(
  network: default,
): NodePair[]

Collects backward (recurrent) connection candidates.

Parameters:

Returns: Candidate source/target pairs.

collectBackwardTraversalContexts

collectBackwardTraversalContexts(
  network: default,
): BackwardCandidateTraversalContext[]

Collects backward traversal contexts for all eligible later nodes.

Parameters:

Returns: Backward traversal contexts.

collectConnectionGroupsForReinit

collectConnectionGroupsForReinit(
  targetNode: default,
): default[][]

Collects all connection groups affected by REINIT_WEIGHT.

Parameters:

Returns: Mutable connection groups.

collectDistinctNodeCandidates

collectDistinctNodeCandidates(
  nodeCandidates: default[],
  excludedNode: default,
): default[]

Collects candidates that are distinct from an excluded node.

Parameters:

Returns: Distinct candidates.

collectForwardCandidatesForSource

collectForwardCandidatesForSource(
  traversalContext: ForwardCandidateTraversalContext,
): NodePair[]

Collects all forward candidates for one source traversal context.

Parameters:

Returns: Candidate source/target pairs.

collectForwardCandidatesFromContext

collectForwardCandidatesFromContext(
  forwardConnectionCandidates: NodePair[],
  traversalContext: ForwardCandidateTraversalContext,
): NodePair[]

Reduces one forward traversal context into candidate connection pairs.

Parameters:

Returns: Updated candidate pairs.

collectForwardConnectionCandidates

collectForwardConnectionCandidates(
  network: default,
): NodePair[]

Collects forward connection candidates.

Parameters:

Returns: Candidate source/target pairs.

collectForwardTraversalContexts

collectForwardTraversalContexts(
  network: default,
): ForwardCandidateTraversalContext[]

Collects forward traversal contexts for all eligible source nodes.

Parameters:

Returns: Forward traversal contexts.

collectMutableNonInputNodes

collectMutableNonInputNodes(
  network: default,
  excludeOutputNodes: boolean,
): default[]

Collects mutable non-input nodes.

Parameters:

Returns: Mutable nodes.

collectNodesByType

collectNodesByType(
  network: default,
  nodeType: string,
): default[]

Collects nodes by type.

Parameters:

Returns: Matching nodes.

collectNodesWithoutSelfLoop

collectNodesWithoutSelfLoop(
  network: default,
): default[]

Collects non-input nodes that do not have self loops.

Parameters:

Returns: Eligible nodes.

collectRemovableBackwardConnections

collectRemovableBackwardConnections(
  network: default,
): default[]

Collects removable backward connections using redundancy constraints.

Parameters:

Returns: Removable backward connections.

collectRemovableForwardConnections

collectRemovableForwardConnections(
  network: default,
): default[]

Collects removable forward connections using redundancy constraints.

Parameters:

Returns: Removable forward connections.

collectSwappableNodesForMutation

collectSwappableNodesForMutation(
  network: default,
  method: MutationMethod | undefined,
): default[]

Collects swap-eligible nodes based on mutation configuration.

Parameters:

Returns: Swap-eligible nodes.

collectTargetLayerPeers

collectTargetLayerPeers(
  network: default,
  targetNode: default,
): default[]

Collects peers around a target node in the same type/layer neighborhood.

Parameters:

Returns: Peer nodes.

collectUngatedConnections

collectUngatedConnections(
  network: default,
): default[]

Collects ungated connections including self-connections.

Parameters:

Returns: Ungated connections.

connectPair

connectPair(
  network: default,
  selectedConnectionPair: NodePair,
): void

Connects source/target node pair.

Parameters:

Returns: Nothing.

containsNode

containsNode(
  nodes: default[],
  node: default,
): boolean

Checks whether a node list contains a node reference.

Parameters:

Returns: True when contained.

countConnectionWhenSourceTargetsPeer

countConnectionWhenSourceTargetsPeer(
  peerConnectionsFromSource: number,
  existingConnection: default,
  countContext: SourcePeerConnectionCountContext,
): number

Counts one connection when it originates from source and targets a peer.

Parameters:

Returns: Updated count.

countSourceConnectionsIntoPeerSet

countSourceConnectionsIntoPeerSet(
  network: default,
  candidateConnection: default,
  targetLayerPeers: default[],
): number

Counts source-originated connections that end inside the target peer set.

Parameters:

Returns: Number of source-to-peer connections.

createBackwardCandidateTraversalContext

createBackwardCandidateTraversalContext(
  network: default,
  laterNodeIndex: number,
): BackwardCandidateTraversalContext

Creates context for one backward-candidate traversal pass.

Parameters:

Returns: Immutable traversal context.

createConnectionGroupReinitContext

createConnectionGroupReinitContext(
  randomValue: () => number,
  methodObject: { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; },
): ConnectionGroupReinitContext

Creates immutable context for connection-group reinitialization.

Parameters:

Returns: Reinitialization context.

createDirectionalConnectionContext

createDirectionalConnectionContext(
  network: default,
  candidateConnection: default,
): DirectionalConnectionContext

Creates indexed directional context for a connection candidate.

Parameters:

Returns: Directional context.

createForwardCandidateTraversalContext

createForwardCandidateTraversalContext(
  network: default,
  sourceNodeIndex: number,
): ForwardCandidateTraversalContext

Creates context for one forward-candidate source traversal pass.

Parameters:

Returns: Immutable traversal context.

createHiddenNode

createHiddenNode(
  randomValue: () => number,
): default

Creates a hidden node with random activation mutation.

Parameters:

Returns: Hidden node.

createRecurrentLayer

createRecurrentLayer(
  blockType: "lstm" | "gru",
): RecurrentLayerShape

Creates recurrent layer by type.

Parameters:

Returns: Created recurrent layer.

createSourcePeerConnectionCountContext

createSourcePeerConnectionCountContext(
  candidateConnection: default,
  targetLayerPeers: default[],
): SourcePeerConnectionCountContext

Creates immutable context for source-to-peer connection counting.

Parameters:

Returns: Count context.

createTargetLayerPeerContext

createTargetLayerPeerContext(
  network: default,
  targetNode: default,
): TargetLayerPeerContext

Creates immutable context for peer-layer collection.

Parameters:

Returns: Peer traversal context.

createWeightSamplingRangeContext

createWeightSamplingRangeContext(
  reinitContext: ConnectionGroupReinitContext,
): WeightSamplingRangeContext

Creates immutable sampling range context.

Parameters:

Returns: Sampling range context.

disconnectConnectionAndGetGater

disconnectConnectionAndGetGater(
  network: default,
  connectionToExpand: default,
): default | null

Disconnects a connection and returns its previous gater.

Parameters:

Returns: Previous gater reference.

disconnectConnectionPair

disconnectConnectionPair(
  network: default,
  selectedConnection: default,
): void

Disconnects selected connection by endpoints.

Parameters:

Returns: Nothing.

disconnectUnexpectedOutgoingConnections

disconnectUnexpectedOutgoingConnections(
  network: default,
  chainNode: default,
  expectedTargetNode: default,
): void

Removes outgoing connections that do not match the expected chain target.

Parameters:

Returns: Nothing.

enableNodeBatchNorm

enableNodeBatchNorm(
  node: default,
): void

Enables internal batch-norm flag on a node.

Parameters:

Returns: Nothing.

ensureConnection

ensureConnection(
  network: default,
  fromNode: default,
  toNode: default,
): default | undefined

Ensures a connection exists and returns it.

Parameters:

Returns: Existing or created connection.

ensureSeedForwardConnectionWhenEmpty

ensureSeedForwardConnectionWhenEmpty(
  network: default,
): boolean

Ensures a seed input->output connection exists when connection list is empty.

Parameters:

Returns: True when mutation may continue.

expandConnectionWithRecurrentBlock

expandConnectionWithRecurrentBlock(
  network: default,
  connectionToExpand: default,
  blockType: "lstm" | "gru",
): void

Replaces one connection with a minimal recurrent block.

Parameters:

Returns: Nothing.

findConnection

findConnection(
  network: default,
  fromNode: default,
  toNode: default,
): default | undefined

Gets a connection between two nodes when it exists.

Parameters:

Returns: Matching connection or undefined.

findFirstNodeByType

findFirstNodeByType(
  network: default,
  nodeType: string,
): default | undefined

Returns the first node by type.

Parameters:

Returns: Matching node or undefined.

hasRedundantEndpoints

hasRedundantEndpoints(
  candidateConnection: default,
): boolean

Checks whether both endpoints maintain at least one redundant edge.

Parameters:

Returns: True when endpoint redundancy exists.

initializeDeterministicChain

initializeDeterministicChain(
  network: default,
  mutationProps: NetworkMutationProps,
  inputNode: default,
  outputNode: default,
): void

Initializes deterministic chain storage and seed edge.

Parameters:

Returns: Nothing.

insertNodeBeforeOutputTail

insertNodeBeforeOutputTail(
  network: default,
  nodeToInsert: default,
  targetNode: default,
  mutationProps: NetworkMutationProps,
): void

Inserts a node before output tail while preserving output block ordering.

Parameters:

Returns: Nothing.

isBackwardCandidateTargetAvailable

isBackwardCandidateTargetAvailable(
  laterNode: default,
  earlierNode: default,
): boolean

Checks whether a backward candidate target is not already projected.

Parameters:

Returns: True when connection may be added.

isBackwardDirectionalContext

isBackwardDirectionalContext(
  directionContext: DirectionalConnectionContext,
): boolean

Checks whether a directional context represents a backward edge.

Parameters:

Returns: True when backward.

isForwardCandidateTargetAvailable

isForwardCandidateTargetAvailable(
  sourceNode: default,
  targetNode: default,
): boolean

Checks whether a forward candidate target is not already projected.

Parameters:

Returns: True when connection may be added.

isForwardConnectionStructurallyRemovable

isForwardConnectionStructurallyRemovable(
  network: default,
  candidateConnection: default,
): boolean

Checks structural preconditions for removable forward connections.

Parameters:

Returns: True when the connection is a forward edge with redundant endpoints.

isForwardDirectionalContext

isForwardDirectionalContext(
  directionContext: DirectionalConnectionContext,
): boolean

Checks whether a directional context represents a forward edge.

Parameters:

Returns: True when forward.

isNodeWithoutSelfLoop

isNodeWithoutSelfLoop(
  candidateNode: default,
): boolean

Checks whether a node currently has no self-loop connections.

Parameters:

Returns: True when the node has no self-loop.

isRemovableBackwardConnection

isRemovableBackwardConnection(
  network: default,
  candidateConnection: default,
): boolean

Evaluates whether a backward connection is safe to remove.

Parameters:

Returns: True when removable.

isRemovableForwardConnection

isRemovableForwardConnection(
  network: default,
  candidateConnection: default,
): boolean

Evaluates whether a forward connection is safe to remove.

Parameters:

Returns: True when removable.

isTargetLayerPeer

isTargetLayerPeer(
  candidateNode: default,
  candidateNodeIndex: number,
  peerContext: TargetLayerPeerContext,
): boolean

Checks whether candidate node belongs to the target peer-layer set.

Parameters:

Returns: True when candidate is an eligible peer.

isTargetLayerPeerTypeMatch

isTargetLayerPeerTypeMatch(
  candidateNode: default,
  peerContext: TargetLayerPeerContext,
): boolean

Checks whether node type matches the target-layer peer type.

Parameters:

Returns: True when type matches.

isTargetLayerPeerWithinDistance

isTargetLayerPeerWithinDistance(
  candidateNodeIndex: number,
  peerContext: TargetLayerPeerContext,
): boolean

Checks whether candidate index lies within allowed peer distance.

Parameters:

Returns: True when within distance.

isUngatedConnection

isUngatedConnection(
  candidateConnection: default,
): boolean

Checks whether a connection has no gater attached.

Parameters:

Returns: True when ungated.

markTopoDirtyIfAcyclic

markTopoDirtyIfAcyclic(
  mutationProps: NetworkMutationProps,
): void

Marks topology caches dirty when acyclic mode is enforced.

Parameters:

Returns: Nothing.

modActivation

modActivation(
  method: MutationMethod | undefined,
): void

Mutates activation function on one random non-input node.

Output-node eligibility is controlled by method.mutateOutput when provided.

Parameters:

Returns: Nothing.

modBias

modBias(
  method: MutationMethod | undefined,
): void

Mutates bias parameters on one random non-input node.

Output nodes remain eligible for this operator.

Parameters:

Returns: Nothing.

modWeight

modWeight(
  method: MutationMethod | undefined,
): void

Perturbs one connection weight using a uniform delta sampled from configured bounds.

The candidate pool includes standard and self-connections.

Parameters:

Returns: Nothing.

pickDistinctNodePair

pickDistinctNodePair(
  swappableNodes: default[],
  randomValue: () => number,
): DistinctNodePair | undefined

Picks two distinct nodes from a candidate set.

Parameters:

Returns: Distinct pair or undefined.

pickDistinctRandomNode

pickDistinctRandomNode(
  nodeCandidates: default[],
  excludedNode: default,
  randomValue: () => number,
): default | undefined

Picks a random node distinct from a given reference.

Parameters:

Returns: Distinct node or undefined.

pickRandomEntry

pickRandomEntry(
  entries: T[],
  randomValue: () => number,
): T | undefined

Selects a random array element.

Parameters:

Returns: Random entry or undefined when empty.

pickRandomNonInputNode

pickRandomNonInputNode(
  network: default,
  excludeOutputNodes: boolean,
  randomValue: () => number,
): default | undefined

Selects a random mutable non-input node.

Parameters:

Returns: Selected mutable node.

pruneDeterministicChainExtraEdges

pruneDeterministicChainExtraEdges(
  network: default,
  deterministicChain: default[],
  outputNode: default,
): void

Prunes side edges from chain nodes to preserve linear deterministic depth.

Parameters:

Returns: Nothing.

reconnectThroughRecurrentLayer

reconnectThroughRecurrentLayer(
  network: default,
  connectionToExpand: default,
  recurrentLayer: RecurrentLayerShape,
): default | undefined

Reconnects a source/target pair through a recurrent layer.

Parameters:

Returns: Latest newly created connection or undefined.

reinitializeConnectionGroupWeights

reinitializeConnectionGroupWeights(
  connections: default[],
  reinitContext: ConnectionGroupReinitContext,
): void

Reinitializes all weights in a connection group.

Parameters:

Returns: Nothing.

reinitWeight

reinitWeight(
  method: MutationMethod | undefined,
): void

Reinitializes incoming, outgoing, and self-connection weights for one target node.

Weight sampling bounds come from method overrides or default mutation bounds.

Parameters:

Returns: Nothing.

removeHiddenNodeAndApplyStabilityNudge

removeHiddenNodeAndApplyStabilityNudge(
  network: default,
  hiddenNode: default,
): void

Removes selected hidden node and applies stability nudge.

Parameters:

Returns: Nothing.

resolveDeterministicChainMutationContext

resolveDeterministicChainMutationContext(
  network: default,
  mutationProps: NetworkMutationProps,
): DeterministicChainMutationContext | undefined

Resolves all deterministic add-node prerequisites into one context object.

Parameters:

Returns: Deterministic context or undefined when one or more prerequisites fail.

resolveDistinctPairWithKnownFirstNode

resolveDistinctPairWithKnownFirstNode(
  swappableNodes: default[],
  firstNode: default,
  randomValue: () => number,
): DistinctNodePair | undefined

Resolves a distinct pair when first node is already known.

Parameters:

Returns: Distinct pair or undefined.

resolveExpectedChainTarget

resolveExpectedChainTarget(
  deterministicChain: default[],
  chainNodeIndex: number,
  outputNode: default,
): default

Resolves the expected outgoing target for a chain node position.

Parameters:

Returns: Expected successor target.

resolveInputOutputEndpoints

resolveInputOutputEndpoints(
  network: default,
): InputOutputEndpoints | undefined

Resolves input/output endpoints required for seed and deterministic flows.

Parameters:

Returns: Endpoint nodes or undefined when missing.

resolveMethodObject

resolveMethodObject(
  method: MutationMethod | undefined,
): { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; }

Extracts method-object form when provided.

Parameters:

Returns: Method object view.

resolveSelectedBackwardConnectionPair

resolveSelectedBackwardConnectionPair(
  network: default,
  randomValue: () => number,
): NodePair | undefined

Resolves random selected backward connection pair.

Parameters:

Returns: Selected source/target pair.

resolveSelectedForwardConnectionPair

resolveSelectedForwardConnectionPair(
  network: default,
  randomValue: () => number,
): NodePair | undefined

Resolves random selected forward connection pair.

Parameters:

Returns: Selected source/target pair.

resolveSelfConnectionTargetNode

resolveSelfConnectionTargetNode(
  network: default,
  randomValue: () => number,
): default | undefined

Resolves random node eligible for self-connection creation.

Parameters:

Returns: Selected node.

sampleUniform

sampleUniform(
  randomValue: () => number,
  minValue: number,
  maxValue: number,
): number

Samples a uniform value from [minValue, maxValue].

Parameters:

Returns: Sampled value.

sampleUniformFromContext

sampleUniformFromContext(
  samplingContext: WeightSamplingRangeContext,
): number

Samples one weight using a prebuilt range context.

Parameters:

Returns: Sampled weight.

selectHiddenNodeForRemoval

selectHiddenNodeForRemoval(
  network: default,
  hiddenNodes: default[],
): default | undefined

Selects a hidden node candidate for SUB_NODE mutation.

Parameters:

Returns: Selected hidden node.

splitConnectionThroughHiddenNode

splitConnectionThroughHiddenNode(
  network: default,
  mutationProps: NetworkMutationProps,
  connectionToSplit: default,
): ConnectionSplitResult

Replaces one connection by inserting a hidden node and reconnecting edges.

Parameters:

Returns: Split result values.

subBackConn

subBackConn(): void

Removes one backward connection that satisfies redundancy constraints.

Parameters:

Returns: Nothing.

subConn

subConn(): void

Removes one forward connection when structural redundancy constraints are satisfied.

Constraints require endpoint redundancy and avoid disconnecting peer-layer groups.

Parameters:

Returns: Nothing.

subGate

subGate(): void

Removes gating from one randomly selected gated connection.

Parameters:

Returns: Nothing.

subNode

subNode(): void

Removes one hidden node and applies a tiny weight nudge for numerical continuity.

The stability nudge helps keep downstream mutation effects observable in edge cases where node removal substantially changes effective signal flow.

Parameters:

Returns: Nothing.

subSelfConn

subSelfConn(): void

Removes one existing self-connection chosen at random.

Parameters:

Returns: Nothing.

swapNodeBiasAndSquash

swapNodeBiasAndSquash(
  firstNode: default,
  secondNode: default,
): void

Swaps bias and squash values between two nodes.

Parameters:

Returns: Nothing.

swapNodes

swapNodes(
  method: MutationMethod | undefined,
): void

Swaps bias and activation squash functions between two distinct mutable nodes.

This provides a lightweight structural-parameter recombination without changing graph connectivity.

Parameters:

Returns: Nothing.

tryDisconnectConnection

tryDisconnectConnection(
  network: default,
  connection: default,
): void

Disconnects a connection pair while suppressing errors.

Parameters:

Returns: Nothing.

tryGateLatestConnection

tryGateLatestConnection(
  network: default,
  previousGater: default | null,
  latestConnection: default | undefined,
): void

Gates the latest connection when both previous gater and target exist.

Parameters:

Returns: Nothing.

tryReassignGateAfterSplit

tryReassignGateAfterSplit(
  network: default,
  randomValue: () => number,
  splitResult: ConnectionSplitResult,
): void

Reassigns prior gater to one of the new split connections when possible.

Parameters:

Returns: Nothing.

warnWhenEnabled

warnWhenEnabled(
  message: string,
): void

Emits a warning when warning mode is enabled.

Parameters:

Returns: Nothing.

wouldDisconnectTargetPeerLayerGroup

wouldDisconnectTargetPeerLayerGroup(
  network: default,
  candidateConnection: default,
): boolean

Determines whether removal would disconnect a target peer-layer group.

Parameters:

Returns: True when peer group would be disconnected.

Generated from source JSDoc • GitHub