Training and Category Lifecycle
Internal operations used to initialize, search, and update models. Each function includes its documented dispatch variants.
Index
initialize!,set_threshold!,stopping_conditionscreate_category!,activation_match!,learn!resonance_search!,resonance_activation!,resonance_match!,resonance_match_scaleget_n_weights,get_n_weights_vec
Initialization and Stopping
initialize!
AdaptiveResonance.initialize! — Function
Summary
Initializes the supervised ARTMAP module for training with sample 'x' and label 'y', setting up the data configuration and instantiating the first category.
Arguments
art::ARTMAP: the ARTMAP module to initialize.x::RealVector: the sample to use for initialization.y::Integer: the initial supervised label.
Examples
julia> my_sfam = SFAM()
SFAM
opts: opts_SFAM
...
julia> initialize!(my_SFAM, [1, 2, 3, 4])
# Method List / Definition Locations
julia initialize!(art, x, y) ```
defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ARTMAP/SFAM.jl:212.
Summary
Initializes the ART module for training with sample 'x' and optional label 'y', setting up the data configuration and instantiating the first category.
This function is used during the first training iteration when the ART module is empty.
Arguments
art::ART: the ART module to initialize.x::RealVector: the sample to use for initialization.y::Integer=0: the optional new label for the first weight of the ART module. If not specified, defaults the new label to 1.
Examples
julia> my_FuzzyART = FuzzyART()
FuzzyART
opts: opts_FuzzyART
...
julia> initialize!(my_FuzzyART, [1, 2, 3, 4])
# Method List / Definition Locations
julia initialize!(art, x; y)
defined at [`/home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/common.jl:28`](https://github.com/AP6YC/AdaptiveResonance.jl/tree/12b791429dfc3715364d39095cd2096fc9448360//src/ART/single/common.jl#L28).
julia initialize!(art, x; y) ```
defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/modules/HypersphereART.jl:196.
set_threshold!
AdaptiveResonance.set_threshold! — Function
Summary
Sets the match threshold of the ART/ARTMAP module as a function of the vigilance parameter.
Depending on selected ART/ARTMAP module and its options, this may be a function of other parameters as well.
Arguments
art::ARTModule: the ART/ARTMAP module for setting a new threshold.
Method List / Definition Locations
set_threshold!(art)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/distributed/modules/DDVFA.jl:273.
set_threshold!(art)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/modules/DVFA.jl:241.
set_threshold!(art)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/modules/FuzzyART.jl:276.
set_threshold!(art)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/modules/HypersphereART.jl:191.
stopping_conditions
AdaptiveResonance.stopping_conditions — Function
stopping_conditions(art::ARTModule) -> Any
Summary
Checks the stopping conditions for an ART module.
Arguments
art::ART: the ART module to check stopping conditions for.
Method List / Definition Locations
stopping_conditions(art)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/lib/common.jl:589.
Category Creation and Learning
create_category!
AdaptiveResonance.create_category! — Function
Summary
Creates a category for the ARTModule module, expanding the weights and incrementing the category labels.
Arguments
art::ARTModule: the ARTModule module to add a category to.x::RealVector: the sample to use for adding a category.y::Integer: the new label for the new category.
Method List / Definition Locations
create_category!(art, sample, label)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/distributed/modules/DDVFA.jl:335.
create_category!(art, x, y; new_cluster)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/modules/DVFA.jl:255.
create_category!(art, x, y)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/modules/FuzzyART.jl:287.
create_category!(art, x, y)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/modules/HypersphereART.jl:206.
create_category!(art, x, y)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ARTMAP/SFAM.jl:220.
create_category!(
art::DVFA,
x::AbstractVector{T} where T<:Real,
y::Integer;
new_cluster
) -> Vector{Int64}
Summary
Creates a new category for the DVFA modules.
Arguments
art::DVFA: the DVFA module to add a category to.x::RealVector: the sample to use for adding a category.y::Integer: the new label for the new category.
Method List / Definition Locations
create_category!(art, x, y; new_cluster)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/modules/DVFA.jl:255.
create_category!(
art::DDVFA,
sample::AbstractVector{T} where T<:Real,
label::Integer
) -> Vector{FuzzyART}
Summary
Create a new category by appending and initializing a new FuzzyART node to F2.
Arguments
art::DDVFA: the DDVFA module to create a new FuzzyART category in.sample::RealVector: the sample to use for instantiating the new category.label::Integer: the new label to use for the new category.
Method List / Definition Locations
create_category!(art, sample, label)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/distributed/modules/DDVFA.jl:335.
activation_match!
AdaptiveResonance.activation_match! — Function
activation_match!(
art::AdaptiveResonance.SingleART,
x::AbstractVector{T} where T<:Real
)
Summary
Computes the activation and match functions of the ART module against sample x.
Arguments
art::SingleART: the single ART module to compute the activation and match values for all weights.x::RealVector: the sample to compute the activation and match functions against.
Examples
julia> my_FuzzyART = FuzzyART()
FuzzyART
opts: opts_FuzzyART
...
julia> x = rand(3, 10)
julia> train!(my_FuzzyART, x)
julia> activation_match!(my_FuzzyART, x[:, 1])Method List / Definition Locations
activation_match!(art, x)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/common.jl:57.
learn!
AdaptiveResonance.learn! — Function
learn!(
art::SFAM,
x::AbstractVector{T} where T<:Real,
index::Integer
)
Summary
In-place learning function.
Method List / Definition Locations
learn!(art, x, index)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ARTMAP/SFAM.jl:283.
learn!(
art::AdaptiveResonance.SingleART,
x::AbstractVector{T} where T<:Real,
index::Integer
)
Summary
In place learning function.
Arguments
art::SingleART: the single ART module to update.x::RealVector: the sample to learn from.index::Integer: the index of the category weight to update.
Method List / Definition Locations
learn!(art, x, index)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/common.jl:80.
Resonance Search
All implemented ART and ARTMAP learners share resonance_search! for candidate traversal, vigilance checks, optional supervisory match tracking, mismatch fallback, and statistics. Learning and category creation remain with the caller. The hooks below specialize activation preparation, lazy match evaluation, and conversion of the tracking increment to each module's match units.
resonance_search!
AdaptiveResonance.resonance_search! — Function
resonance_search!(
accept,
art::ARTModule,
sample::AbstractVector{T} where T<:Real;
threshold,
match_tracking
) -> Tuple{Any, Bool}
Summary
Evaluate the resonance search for a module.
Arguments
accept::F: anonymous function to pass the accept/reject decision to the ART module.art::ARTModule: the ART module running the resonance search.sample::RealVector: the sample presented for search.match_tracking=art.opts.match_tracking: continue searching with raised vigilance after a callback rejects a label.threshold=art.threshold: the vigilance threshold (can be rho or a function that varies during training/evaluation). Defaultart.threshold
Description
Evaluates a preprocessed sample against a nonempty module and return (bmu, mismatch). On mismatch, bmu is the original maximum-activation category. Records its activation, match, and mismatch status in art.stats.
Candidates are visited in descending activation order, either by sorting or by inhibiting a working copy with -Inf (determined by the art.opts.sort flag). The original activations are retained for statistics, including when no category resonates.
accept(bmu) is called only when vigilance passes: return true to accept, false to signal a supervisory mismatch, or nothing to continue searching. On false, match_tracking=true raises the local vigilance above the rejected match by opts.epsilon (scaled to match units) and continues; otherwise search stops. The baseline is never mutated, and tracked vigilance is not capped, so conflicting exact matches can exhaust the search and request a new category. threshold may be a number or a zero-argument function for a changing vigilance threshold to recompute it (such as in vigilance tracking). The default callback checks labels only when supervised=true (default: y != 0). ARTMAP callers explicitly enable supervision so label zero is also supported.
Examples
resonance_search!(art, sample; threshold=art.threshold, y=0)
resonance_search!(accept, art, sample; threshold=art.threshold)Method List / Definition Locations
resonance_search!(
accept,
art,
sample;
threshold,
match_tracking
)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/lib/resonance.jl:38.
resonance_activation!
AdaptiveResonance.resonance_activation! — Function
resonance_activation!(
art::ARTModule,
sample::AbstractVector{T} where T<:Real
)
Summary
Prepare category activations and match storage before resonance search.
Arguments
art::ARTModule: the ART module running the resonance search.sample::RealVector: the preprocessed sample presented for search.
Description
The default delegates to activation_match!. SFAM prepares activations and defers matches until candidates are visited; DDVFA first evaluates its local modules and computes global activations using the configured linkage.
Method List / Definition Locations
resonance_activation!(art, sample)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/distributed/modules/DDVFA.jl:512.
resonance_activation!(art, sample)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ARTMAP/SFAM.jl:293.
resonance_activation!(art, sample)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/lib/resonance.jl:139.
resonance_match!
AdaptiveResonance.resonance_match! — Function
resonance_match!(
art::ARTModule,
sample::AbstractVector{T} where T<:Real,
bmu::Integer
) -> Any
Summary
Return the candidate's match value during resonance search.
Arguments
art::ARTModule: the ART module running the resonance search.sample::RealVector: the preprocessed sample presented for search.bmu::Integer: the index of the candidate category being evaluated.
Description
The default reads art.M[bmu]; SFAM and DDVFA compute and store this value lazily for each visited candidate, using their match function or linkage respectively.
Method List / Definition Locations
resonance_match!(art, sample, bmu)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/distributed/modules/DDVFA.jl:521.
resonance_match!(art, sample, bmu)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ARTMAP/SFAM.jl:301.
resonance_match!(art, sample, bmu)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/lib/resonance.jl:155.
resonance_match_scale
AdaptiveResonance.resonance_match_scale — Function
resonance_match_scale(_::ARTModule) -> Float64
Summary
Return the scale for converting a vigilance-parameter increment to match units.
Arguments
art::ARTModule: the ART module whose match scale determines the tracking increment.
Description
Resonance search raises its temporary threshold by art.opts.epsilon * resonance_match_scale(art). The default scale is one. DVFA uses the feature dimension; FuzzyART and DDVFA use dim ^ gamma_ref when gamma normalization is enabled, and one otherwise.
Method List / Definition Locations
resonance_match_scale(art)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/distributed/modules/DDVFA.jl:526.
resonance_match_scale(art)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/modules/DVFA.jl:331.
resonance_match_scale(art)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/single/modules/FuzzyART.jl:355.
resonance_match_scale(_)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/lib/resonance.jl:170.
Distributed Model State
get_n_weights
AdaptiveResonance.get_n_weights — Function
get_n_weights(art::DDVFA) -> Int64
Summary
Convenience function; return the sum total number of weights in the DDVFA module.
Method List / Definition Locations
get_n_weights(art)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/distributed/modules/DDVFA.jl:506.
get_n_weights_vec
AdaptiveResonance.get_n_weights_vec — Function
get_n_weights_vec(art::DDVFA) -> Vector{Int64}
Summary
Convenience function; return the number of weights in each category as a vector.
Arguments
art::DDVFA: the DDVFA module to get all of the weights from as a list.
Method List / Definition Locations
get_n_weights_vec(art)defined at /home/runner/work/AdaptiveResonance.jl/AdaptiveResonance.jl/src/ART/distributed/modules/DDVFA.jl:499.