AdaptiveResonance.AdaptiveResonance
— ModuleMain module for AdaptiveResonance.jl
, a Julia package of adaptive resonance theory algorithms.
This module exports all of the ART modules, options, and utilities used by the AdaptiveResonance.jl package.
For full usage, see the official guide at https://ap6yc.github.io/AdaptiveResonance.jl/dev/man/guide/.
Basic Usage
Install and import the package in a script with
using Pkg
Pkg.add("AdaptiveResonance")
using AdaptiveResonance
then create an ART module with default options
my_art = DDVFA()
or custom options via keyword arguments
my_art = DDVFA(rho_ub=0.45, rho_ub=0.7)
Train all models with train!
and conduct inference with classify
. In batch, samples are interpreted in the Julia column-major fashion with dimensions (n_dim, n_samples)
(i.e., columns are samples).
Train unsupervised ART modules incrementally or in batch with optional labels as a keyword argument y
# Load your data somehow
samples, labels = load_some_data()
# Unsupervised batch
train!(my_art, samples)
# Supervised batch
train!(my_art, samples, y=labels)
# Unsupervised incremental
for ix in eachindex(labels)
train!(my_art, samples[:, ix])
end
# Supervised incremental
for ix in eachindex(labels)
train!(my_art, samples[:, ix], y=labels[ix])
end
Train supervised ARTMAP with positional arguments
my_artmap = SFAM()
train!(my_artmap, samples, labels)
With either module, conduct inference with classify(art, samples)
# Batch inference
y_hat = classify(my_art, test_samples)
# Incremental inference
for ix in eachindex(test_labels)
y_hat[ix] = classify(my_artmap, test_samples[:, ix])
end
Imports
The following names are imported by the package as dependencies:
Base
Core
Distributed
DocStringExtensions
ElasticArrays
Logging
NumericalTypeAliases
Parameters
Pkg
ProgressBars
SharedArrays
Exports
The following names are exported and available when using
the package:
ACTIVATION_FUNCTIONS
ADAPTIVERESONANCE_MODULES
ADAPTIVERESONANCE_VERSION
ART
ARTMAP
ARTMAP_MODULES
ARTModule
ARTOpts
ART_MODULES
DAM
DDVFA
DDVFA_METHODS
DVFA
DataConfig
FAM
FuzzyART
GammaNormalizedFuzzyART
MATCH_FUNCTIONS
SFAM
UPDATE_FUNCTIONS
artscene_filter
classify
complement_code
data_setup!
get_W
get_data_characteristics
linear_normalization
opts_DAM
opts_DDVFA
opts_DVFA
opts_FAM
opts_FuzzyART
opts_GammaNormalizedFuzzyART
opts_SFAM
performance
train!
AdaptiveResonance.ACTIVATION_FUNCTIONS
— ConstantACTIVATION_FUNCTIONS
Description
Enumerates all of the activation functions available in the package.
AdaptiveResonance.ACTIVATION_FUNCTIONS_DOCS
— ConstantACTIVATIONFUNCTIONSDOCS
Description
Common docstring for listing available activation functions.
AdaptiveResonance.ADAPTIVERESONANCE_MODULES
— ConstantADAPTIVERESONANCE_MODULES
Description
A combined list of all unsupervised ART and supervised ARTMAP modules from the AdaptiveResonance.jl
package.
AdaptiveResonance.ADAPTIVERESONANCE_VERSION
— ConstantADAPTIVERESONANCE_VERSION
Description
A constant that contains the version of the installed AdaptiveResonance.jl package.
This value is computed at compile time, so it may be used to programmatically verify the version of AdaptiveResonance
that is installed in case a compat
entry in your Project.toml is missing or otherwise incorrect.
AdaptiveResonance.ARTIterator
— TypeARTIterator
Description
Acceptable iterators for ART module training and inference
AdaptiveResonance.ARTMAP_MODULES
— ConstantARTMAP_MODULES
Description
A list of supervised ARTMAP modules that are available in the AdaptiveResonance.jl
package.
AdaptiveResonance.ART_DIM
— ConstantART_DIM
Description
AdaptiveResonance.jl convention for which 2-D dimension contains the feature dimension.
AdaptiveResonance.ART_MODULES
— ConstantART_MODULES
Description
A list of (default) unsupervised ART modules that are available in the AdaptiveResonance.jl
package.
AdaptiveResonance.ART_SAMPLES
— ConstantART_SAMPLES
Description
AdaptiveResonance.jl convention for which 2-D dimension contains the number of samples.
AdaptiveResonance.DDVFA_METHODS
— ConstantDDVFA_METHODS
Description
A list of all DDVFA similarity linkage methods.
AdaptiveResonance.MATCH_FUNCTIONS
— ConstantMATCH_FUNCTIONS
Description
Enumerates all of the match functions available in the package.
AdaptiveResonance.MATCH_FUNCTIONS_DOCS
— ConstantMATCHFUNCTIONSDOCS
Description
Common docstring for listing available match functions.
AdaptiveResonance.UPDATE_FUNCTIONS
— ConstantUPDATE_FUNCTIONS
Description
Enumerates all of the update functions available in the package.
AdaptiveResonance._ARGS_MATRIX_REPLACE
— ConstantARGSMATRIX_REPLACE
Description
Common docstring: shared arguments string for functions updating a column in a matrix.
AdaptiveResonance._ARG_ART
— ConstantARGART
Description
Common docstring: shared argument docstring for ART module arguments.
AdaptiveResonance._ARG_ART_X_W
— ConstantARGARTXW
Description
Common docstring: shared arguments string for methods using an ART module, sample 'x', and weight vector 'W'.
AdaptiveResonance._ARG_INDEX
— ConstantARGINDEX
Description
Common docstring: shared argument docstring for the index of the weight column.
AdaptiveResonance._ARG_W
— ConstantARGW
Description
Common docstring: shared argument docstring for the weight vector.
AdaptiveResonance._ARG_X
— ConstantARGX
Description
Common docstring: shared argument docstring for the input sample of features.
AdaptiveResonance._COMMON_DOC
— ConstantCOMMONDOC
Description
Docstring prefix denoting that the constant is used as a common docstring element for other docstrings.
AdaptiveResonance._OPTS_DOCSTRING
— ConstantOPTSDOCSTRING
Description
Common docstring: shared options docstring, inserted at the end of opts_<...>
structs.
AdaptiveResonance.ART
— Typeabstract type ART <: ARTModule
Summary
Abstract supertype for all default unsupervised ART modules.
Fields
AdaptiveResonance.ARTMAP
— Typeabstract type ARTMAP <: ARTModule
Summary
Abstract supertype for all supervised ARTMAP modules.
Fields
AdaptiveResonance.ARTMatrix
— TypeARTMatrix
Description
The type of matrix used by the AdaptiveResonance.jl package, used to configure matrix growth behavior.
AdaptiveResonance.ARTModule
— Typeabstract type ARTModule
Summary
Abstract supertype for both ART (unsupervised) and ARTMAP (supervised) modules.
Fields
AdaptiveResonance.ARTOpts
— Typeabstract type ARTOpts
Summary
Abstract supertype for all ART module options.
Fields
AdaptiveResonance.ARTStats
— TypeARTStats
Description
Definition of the ART module statistics dictionary, used to generate and store various logs during training and testing.
AdaptiveResonance.ARTVector
— TypeARTVector
Description
The type of vector used by the AdaptiveResonance.jl package, used to configure vector growth behvior.
AdaptiveResonance.AbstractFuzzyART
— Typeabstract type AbstractFuzzyART <: ART
Summary
Abstract supertype of FuzzyART modules.
Fields
AdaptiveResonance.DDVFA
— Typemutable struct DDVFA <: ART
Summary
Distributed Dual Vigilance Fuzzy ARTMAP module struct.
For module options, see AdaptiveResonance.opts_DDVFA
.
References
- L. E. Brito da Silva, I. Elnabarawy, and D. C. Wunsch, 'Distributed dual vigilance fuzzy adaptive resonance theory learns online, retrieves arbitrarily-shaped clusters, and mitigates order dependence,' Neural Networks, vol. 121, pp. 208-228, 2020, doi: 10.1016/j.neunet.2019.08.033.
- G. Carpenter, S. Grossberg, and D. Rosen, 'Fuzzy ART: Fast stable learning and categorization of analog patterns by an adaptive resonance system,' Neural Networks, vol. 4, no. 6, pp. 759-771, 1991.
Fields
opts::opts_DDVFA
: DDVFA options struct.
subopts::opts_FuzzyART
: FuzzyART options struct used for all F2 nodes.
config::DataConfig
: Data configuration struct.
threshold::Float64
: Operating module threshold value, a function of the vigilance parameter.
F2::Vector{FuzzyART}
: List of F2 nodes (themselves FuzzyART modules).
labels::Vector{Int64}
: Incremental list of labels corresponding to each F2 node, self-prescribed or supervised.
n_categories::Int64
: Number of total categories.
epoch::Int64
: Current training epoch.
T::Vector{Float64}
: DDVFA activation values.
M::Vector{Float64}
: DDVFA match values.
stats::Dict{String, Any}
: Runtime statistics for the module, implemented as a dictionary containing entries at the end of each training iteration. These entries include the best-matching unit index and the activation and match values of the winning node.
AdaptiveResonance.DDVFA
— MethodDDVFA(opts::opts_DDVFA) -> DDVFA
Summary
Implements a DDVFA learner with specified options.
Arguments
opts::opts_DDVFA
: the DDVFA options (seeAdaptiveResonance.opts_DDVFA
).
Examples
julia> my_opts = opts_DDVFA()
julia> DDVFA(my_opts)
DDVFA
opts: opts_DDVFA
subopts: opts_FuzzyART
...
Method List / Definition Locations
DDVFA(opts)
AdaptiveResonance.DDVFA
— MethodDDVFA(; kwargs...) -> DDVFA
Summary
Implements a DDVFA learner with optional keyword arguments.
Arguments
kwargs
: keyword arguments to pass to the DDVFA options struct (seeAdaptiveResonance.opts_DDVFA
.)
Examples
By default:
julia> DDVFA()
DDVFA
opts: opts_DDVFA
subopts: opts_FuzzyART
...
or with keyword arguments:
julia> DDVFA(rho_lb=0.4, rho_ub = 0.75)
DDVFA
opts: opts_DDVFA
subopts: opts_FuzzyART
...
Method List / Definition Locations
DDVFA(; kwargs...)
AdaptiveResonance.DVFA
— Typemutable struct DVFA <: AdaptiveResonance.AbstractFuzzyART
Summary
Dual Vigilance Fuzzy ARTMAP module struct.
For module options, see AdaptiveResonance.opts_DVFA
.
References:
- L. E. Brito da Silva, I. Elnabarawy and D. C. Wunsch II, 'Dual Vigilance Fuzzy ART,' Neural Networks Letters. To appear.
- G. Carpenter, S. Grossberg, and D. Rosen, 'Fuzzy ART: Fast stable learning and categorization of analog patterns by an adaptive resonance system,' Neural Networks, vol. 4, no. 6, pp. 759-771, 1991.
Fields
opts::opts_DVFA
: DVFA options struct.
config::DataConfig
: Data configuration struct.
threshold_ub::Float64
: Operating upper bound module threshold value, a function of the upper bound vigilance parameter.
threshold_lb::Float64
: Operating lower bound module threshold value, a function of the lower bound vigilance parameter.
labels::Vector{Int64}
: Incremental list of labels corresponding to each F2 node, self-prescribed or supervised.
W::ElasticArrays.ElasticMatrix{Float64, V} where V<:DenseVector{Float64}
: Category weight matrix.
T::Vector{Float64}
: Activation values for every weight for a given sample.
M::Vector{Float64}
: Match values for every weight for a given sample.
n_categories::Int64
: Number of category weights (F2 nodes).
n_clusters::Int64
: Number of labeled clusters, may be lower thann_categories
epoch::Int64
: Current training epoch.
stats::Dict{String, Any}
: Runtime statistics for the module, implemented as a dictionary containing entries at the end of each training iteration. These entries include the best-matching unit index and the activation and match values of the winning node.
AdaptiveResonance.DVFA
— MethodDVFA(opts::opts_DVFA) -> DVFA
Summary
Implements a DVFA learner with specified options.
Arguments
opts::opts_DVFA
: the DVFA options (seeAdaptiveResonance.opts_DVFA
).
Examples
julia> my_opts = opts_DVFA()
julia> DVFA(my_opts)
DVFA
opts: opts_DVFA
...
Method List / Definition Locations
DVFA(opts)
AdaptiveResonance.DVFA
— MethodDVFA(; kwargs...) -> DVFA
Summary
Implements a DVFA learner with optional keyword arguments.
Arguments
kwargs
: keyword arguments to pass to the DVFA options struct (seeAdaptiveResonance.opts_DVFA
.)
Examples
By default:
julia> DVFA()
DVFA
opts: opts_DVFA
...
or with keyword arguments:
julia> DVFA(rho=0.7)
DVFA
opts: opts_DVFA
...
Method List / Definition Locations
DVFA(; kwargs...)
AdaptiveResonance.DataConfig
— Typemutable struct DataConfig
Summary
Container to standardize training/testing data configuration.
This container declares if a data configuration has been setup, what the original and complement coded dimensions are, and what the minimums and maximums of the values along each feature dimension are.
Fields
setup::Bool
: Flag if data has been setup yet or not.
mins::Vector{Float64}
: List of minimum values for each feature.
maxs::Vector{Float64}
: List of maximum values for each feature.
dim::Int64
: Dimensionality of the feature vectors (i.e., number of features).
dim_comp::Int64
: Complement coded feature dimensionality, twice the size ofdim
.
AdaptiveResonance.DataConfig
— MethodDataConfig(
data::AbstractMatrix{T} where T<:Real
) -> DataConfig
Summary
Convenience constructor for DataConfig, requiring only the data matrix.
Arguments
data::RealMatrix
: the 2-D batch of data to be used for inferring the data configuration.
Method List / Definition Locations
DataConfig(data)
AdaptiveResonance.DataConfig
— MethodDataConfig(
mins::AbstractVector{T} where T<:Real,
maxs::AbstractVector{T} where T<:Real
) -> DataConfig
Summary
Convenience constructor for DataConfig, requiring only mins and maxs of the features.
This constructor is used when the mins and maxs differ across features. The dimension is inferred by the length of the mins and maxs.
Arguments
mins::RealVector
: a vector of minimum values for each feature dimension.maxs::RealVector
: a vector of maximum values for each feature dimension.
Method List / Definition Locations
DataConfig(mins, maxs)
AdaptiveResonance.DataConfig
— MethodDataConfig(min::Real, max::Real, dim::Integer) -> DataConfig
Summary
Convenience constructor for DataConfig, requiring only a global min, max, and dim.
This constructor is used in the case that the feature mins and maxs are all the same respectively.
Arguments
min::Real
: the minimum value across all features.max::Real
: the maximum value across all features.dim::Integer
: the dimension of the features, which must be provided because it cannot be inferred from just the minimum or maximum values.
Method List / Definition Locations
DataConfig(min, max, dim)
AdaptiveResonance.DataConfig
— MethodDataConfig() -> DataConfig
Summary
Default constructor for a data configuration, not set up.
Method List / Definition Locations
DataConfig()
AdaptiveResonance.FAM
— Typemutable struct FAM <: ARTMAP
Summary
Fuzzy ARTMAP struct.
For module options, see AdaptiveResonance.opts_FAM
.
References
- G. A. Carpenter, S. Grossberg, N. Markuzon, J. H. Reynolds, and D. B. Rosen, “Fuzzy ARTMAP: A Neural Network Architecture for Incremental Supervised Learning of Analog Multidimensional Maps,” IEEE Trans. Neural Networks, vol. 3, no. 5, pp. 698-713, 1992, doi: 10.1109/72.159059.
Fields
opts::opts_FAM
: Fuzzy ARTMAP options struct.
config::DataConfig
: Data configuration struct.
W::ElasticArrays.ElasticMatrix{Float64, V} where V<:DenseVector{Float64}
: Category weight matrix.
labels::Vector{Int64}
: Incremental list of labels corresponding to each F2 node, self-prescribed or supervised.
n_categories::Int64
: Number of category weights (F2 nodes).
epoch::Int64
: Current training epoch.
AdaptiveResonance.FAM
— MethodFAM(opts::opts_FAM) -> FAM
Summary
Implements a Fuzzy ARTMAP learner with specified options.
Examples
julia> opts = opts_FAM()
julia> FAM(opts)
FAM
opts: opts_FAM
...
Method List / Definition Locations
FAM(opts)
AdaptiveResonance.FAM
— MethodFAM(; kwargs...) -> FAM
Summary
Implements a Fuzzy ARTMAP learner with optional keyword arguments.
Examples
By default:
julia> FAM()
FAM
opts: opts_FAM
...
or with keyword arguments:
julia> FAM(rho=0.7)
FAM
opts: opts_FAM
...
Method List / Definition Locations
FAM(; kwargs...)
AdaptiveResonance.FuzzyART
— Typemutable struct FuzzyART <: AdaptiveResonance.AbstractFuzzyART
Summary
Gamma-Normalized Fuzzy ART learner struct
For module options, see AdaptiveResonance.opts_FuzzyART
.
References
- G. Carpenter, S. Grossberg, and D. Rosen, 'Fuzzy ART: Fast stable learning and categorization of analog patterns by an adaptive resonance system,' Neural Networks, vol. 4, no. 6, pp. 759-771, 1991.
Fields
opts::opts_FuzzyART
: FuzzyART options struct.
config::DataConfig
: Data configuration struct.
threshold::Float64
: Operating module threshold value, a function of the vigilance parameter.
labels::Vector{Int64}
: Incremental list of labels corresponding to each F2 node, self-prescribed or supervised.
T::Vector{Float64}
: Activation values for every weight for a given sample.
M::Vector{Float64}
: Match values for every weight for a given sample.
W::ElasticArrays.ElasticMatrix{Float64, V} where V<:DenseVector{Float64}
: Category weight matrix.
n_instance::Vector{Int64}
: Number of weights associated with each category.
n_categories::Int64
: Number of category weights (F2 nodes).
epoch::Int64
: Current training epoch.
stats::Dict{String, Any}
: Runtime statistics for the module, implemented as a dictionary containing entries at the end of each training iteration. These entries include the best-matching unit index and the activation and match values of the winning node.
AdaptiveResonance.FuzzyART
— MethodFuzzyART(
opts::opts_FuzzyART,
sample::AbstractVector{T} where T<:Real;
preprocessed
) -> FuzzyART
Summary
Create and initialize a FuzzyART with a single sample in one step.
Principally used as a method for initialization within DDVFA.
Arguments
opts::opts_FuzzyART
: the FuzzyART options contains.sample::RealVector
: the sample to use as a basis for setting up the FuzzyART.preprocessed::Bool=false
: flag for if the sample is already complement coded and normalized.
Method List / Definition Locations
FuzzyART(opts, sample; preprocessed)
AdaptiveResonance.FuzzyART
— MethodFuzzyART(opts::opts_FuzzyART) -> FuzzyART
Summary
Implements a Fuzzy ART learner with specified options.
Arguments
opts::opts_FuzzyART
: the FuzzyART options struct with specified options (seeAdaptiveResonance.opts_FuzzyART
).
Examples
julia> FuzzyART(opts)
FuzzyART
opts: opts_FuzzyART
...
Method List / Definition Locations
FuzzyART(opts)
AdaptiveResonance.FuzzyART
— MethodFuzzyART(; kwargs...) -> FuzzyART
Summary
Implements a Fuzzy ART learner with optional keyword arguments.
Arguments
kwargs
: keyword arguments of FuzzyART options (seeAdaptiveResonance.opts_FuzzyART
).
Examples
By default:
julia> FuzzyART()
FuzzyART
opts: opts_FuzzyART
...
or with keyword arguments:
julia> FuzzyART(rho=0.7)
FuzzyART
opts: opts_FuzzyART
...
Method List / Definition Locations
FuzzyART(; kwargs...)
AdaptiveResonance.MergeART
— Typemutable struct MergeART <: ART
Summary
MergeART module struct.
For module options, see AdaptiveResonance.opts_MergeART
.
References
- L. E. Brito da Silva, I. Elnabarawy, and D. C. Wunsch, 'Distributed dual vigilance fuzzy adaptive resonance theory learns online, retrieves arbitrarily-shaped clusters, and mitigates order dependence,' Neural Networks, vol. 121, pp. 208-228, 2020, doi: 10.1016/j.neunet.2019.08.033.
- G. Carpenter, S. Grossberg, and D. Rosen, 'Fuzzy ART: Fast stable learning and categorization of analog patterns by an adaptive resonance system,' Neural Networks, vol. 4, no. 6, pp. 759-771, 1991.
Fields
opts::opts_DDVFA
: DDVFA options struct.
subopts::opts_FuzzyART
: FuzzyART options struct used for all F2 nodes.
config::DataConfig
: Data configuration struct.
threshold::Float64
: Operating module threshold value, a function of the vigilance parameter.
F2::Vector{FuzzyART}
: List of F2 nodes (themselves FuzzyART modules).
labels::Vector{Int64}
: Incremental list of labels corresponding to each F2 node, self-prescribed or supervised.
n_categories::Int64
: Number of total categories.
epoch::Int64
: Current training epoch.
T::Vector
: DDVFA activation values.
M::Vector
: DDVFA match values.
stats::Dict{String, Any}
: Runtime statistics for the module, implemented as a dictionary containing entries at the end of each training iteration. These entries include the best-matching unit index and the activation and match values of the winning node.
AdaptiveResonance.SFAM
— Typemutable struct SFAM <: ARTMAP
Summary
Simple Fuzzy ARTMAP struct.
For module options, see AdaptiveResonance.opts_SFAM
.
References
- G. A. Carpenter, S. Grossberg, N. Markuzon, J. H. Reynolds, and D. B. Rosen, “Fuzzy ARTMAP: A Neural Network Architecture for Incremental Supervised Learning of Analog Multidimensional Maps,” IEEE Trans. Neural Networks, vol. 3, no. 5, pp. 698-713, 1992, doi: 10.1109/72.159059.
Fields
opts::opts_SFAM
: Simplified Fuzzy ARTMAP options struct.
config::DataConfig
: Data configuration struct.
W::ElasticArrays.ElasticMatrix{Float64, V} where V<:DenseVector{Float64}
: Category weight matrix.
labels::Vector{Int64}
: Incremental list of labels corresponding to each F2 node, self-prescribed or supervised.
n_categories::Int64
: Number of category weights (F2 nodes).
epoch::Int64
: Current training epoch.
T::Vector{Float64}
: DDVFA activation values.
M::Vector{Float64}
: DDVFA match values.
stats::Dict{String, Any}
: Runtime statistics for the module, implemented as a dictionary containing entries at the end of each training iteration. These entries include the best-matching unit index and the activation and match values of the winning node.
AdaptiveResonance.SFAM
— MethodSFAM(opts::opts_SFAM) -> SFAM
Summary
Implements a Simple Fuzzy ARTMAP learner with specified options.
Arguments
opts::opts_SFAM
: the Simple Fuzzy ARTMAP options (seeAdaptiveResonance.opts_SFAM
).
Examples
julia> opts = opts_SFAM()
julia> SFAM(opts)
SFAM
opts: opts_SFAM
...
Method List / Definition Locations
SFAM(opts)
AdaptiveResonance.SFAM
— MethodSFAM(; kwargs...) -> SFAM
Summary
Implements a Simple Fuzzy ARTMAP learner with optional keyword arguments.
Arguments
kwargs
: keyword arguments to pass to the Simple Fuzzy ARTMAP options struct (seeAdaptiveResonance.opts_SFAM
.)
Examples
By default:
julia> SFAM()
SFAM
opts: opts_SFAM
...
or with keyword arguments:
julia> SFAM(rho=0.6)
SFAM
opts: opts_SFAM
...
Method List / Definition Locations
SFAM(; kwargs...)
AdaptiveResonance.opts_DDVFA
— Typemutable struct opts_DDVFA <: ARTOpts
Summary
Distributed Dual Vigilance Fuzzy ART options struct.
These options are a Parameters.jl
struct, taking custom options keyword arguments. Each field has a default value listed below.
Fields
rho_lb::Float64
: Lower-bound vigilance parameter: rho_lb ∈ [0, 1]. Default: 0.7rho_ub::Float64
: Upper bound vigilance parameter: rho_ub ∈ [0, 1]. Default: 0.85alpha::Float64
: Choice parameter: alpha > 0. Default: 0.001beta::Float64
: Learning parameter: beta ∈ (0, 1]. Default: 1.0gamma::Float64
: Pseudo kernel width: gamma >= 1. Default: 3.0gamma_ref::Float64
: Reference gamma for normalization: 0 <= gamma_ref < gamma. Default: 1.0similarity::Symbol
: Similarity method (activation and match): similarity ∈ [:single, :average, :complete, :median, :weighted, :centroid]. Default: :singlemax_epoch::Int64
: Maximum number of epochs during training: max_epochs ∈ (1, Inf). Default: 1display::Bool
: Display flag for progress bars. Default: falsegamma_normalization::Bool
: Flag to normalize the threshold by the feature dimension. Default: trueuncommitted::Bool
: Flag to use an uncommitted node when learning.If true, new weights are created with ones(dim) and learn on the complement-coded sample. If false, fast-committing is used where the new weight is simply the complement-coded sample. Default: false
activation::Symbol
: Selected activation function. Default: :gamma_activationmatch::Symbol
: Selected match function. Default: :gamma_matchupdate::Symbol
: Selected weight update function. Default: :basic_update
AdaptiveResonance.opts_DVFA
— Typemutable struct opts_DVFA <: ARTOpts
Summary
Dual Vigilance Fuzzy ART options struct.
These options are a Parameters.jl
struct, taking custom options keyword arguments. Each field has a default value listed below.
Fields
rho_lb::Float64
: Lower-bound vigilance parameter: rho_lb ∈ [0, 1]. Default: 0.55rho_ub::Float64
: Upper bound vigilance parameter: rho_ub ∈ [0, 1]. Default: 0.75alpha::Float64
: Choice parameter: alpha > 0. Default: 0.001beta::Float64
: Learning parameter: beta ∈ (0, 1]. Default: 1.0max_epoch::Int64
: Maximum number of epochs during training. Default: 1display::Bool
: Display flag for progress bars. Default: falseuncommitted::Bool
: Flag to use an uncommitted node when learning.If true, new weights are created with ones(dim) and learn on the complement-coded sample. If false, fast-committing is used where the new weight is simply the complement-coded sample. Default: false
activation::Symbol
: Selected activation function. Default: :basic_activationmatch::Symbol
: Selected match function. Default: :unnormalized_matchupdate::Symbol
: Selected weight update function. Default: :basic_update
AdaptiveResonance.opts_FAM
— Typemutable struct opts_FAM <: ARTOpts
Summary
Implements a Fuzzy ARTMAP learner's options.
These options are a Parameters.jl
struct, taking custom options keyword arguments. Each field has a default value listed below.
Fields
rho::Float64
: Vigilance parameter: rho ∈ [0, 1]. Default: 0.6alpha::Float64
: Choice parameter: alpha > 0. Default: 1.0e-7epsilon::Float64
: Match tracking parameter: epsilon ∈ (0, 1). Default: 0.001beta::Float64
: Learning parameter: beta ∈ (0, 1]. Default: 1.0max_epochs::Int64
: Maximum number of epochs during training: max_epochs ∈ [1, Inf) Default: 1uncommitted::Bool
: Uncommitted node flag. Default: truedisplay::Bool
: Display flag for progress bars. Default: false
AdaptiveResonance.opts_FuzzyART
— Typemutable struct opts_FuzzyART <: ARTOpts
Summary
Gamma-Normalized Fuzzy ART options struct.
These options are a Parameters.jl
struct, taking custom options keyword arguments. Each field has a default value listed below.
Fields
rho::Float64
: Vigilance parameter: rho ∈ [0, 1]. Default: 0.6alpha::Float64
: Choice parameter: alpha > 0. Default: 0.001beta::Float64
: Learning parameter: beta ∈ (0, 1]. Default: 1.0gamma::Float64
: Pseudo kernel width: gamma >= 1. Default: 3.0gamma_ref::Float64
: Reference gamma for normalization: 0 <= gamma_ref < gamma. Default: 1.0max_epoch::Int64
: Maximum number of epochs during training: max_epochs ∈ (1, Inf). Default: 1display::Bool
: Display flag for progress bars. Default: falsegamma_normalization::Bool
: Flag to normalize the threshold by the feature dimension.NOTE: this flag overwrites the
activation
andmatch
settings here to their gamma-normalized equivalents along with adjusting the thresold. Default: falseuncommitted::Bool
: Flag to use an uncommitted node when learning.If true, new weights are created with ones(dim) and learn on the complement-coded sample. If false, fast-committing is used where the new weight is simply the complement-coded sample. Default: false
activation::Symbol
: Selected activation function. Default: :basic_activationmatch::Symbol
: Selected match function. Default: :basic_matchupdate::Symbol
: Selected weight update function. Default: :basic_update
AdaptiveResonance.opts_MergeART
— Typemutable struct opts_MergeART <: ARTOpts
Summary
MergeART options struct.
These options are a Parameters.jl
struct, taking custom options keyword arguments. Each field has a default value listed below.
Fields
rho_lb::Float64
: Lower-bound vigilance parameter: rho_lb ∈ [0, 1]. Default: 0.7rho_ub::Float64
: Upper bound vigilance parameter: rho_ub ∈ [0, 1]. Default: 0.85alpha::Float64
: Choice parameter: alpha > 0. Default: 0.001beta::Float64
: Learning parameter: beta ∈ (0, 1]. Default: 1.0gamma::Float64
: Pseudo kernel width: gamma >= 1. Default: 3.0gamma_ref::Float64
: Reference gamma for normalization: 0 <= gamma_ref < gamma. Default: 1.0similarity::Symbol
: Similarity method (activation and match): similarity ∈ [:single, :average, :complete, :median, :weighted, :centroid]. Default: :singlemax_epoch::Int64
: Maximum number of epochs during training: max_epochs ∈ (1, Inf). Default: 1display::Bool
: Display flag for progress bars. Default: falsegamma_normalization::Bool
: Flag to normalize the threshold by the feature dimension. Default: trueuncommitted::Bool
: Flag to use an uncommitted node when learning.If true, new weights are created with ones(dim) and learn on the complement-coded sample. If false, fast-committing is used where the new weight is simply the complement-coded sample. Default: false
activation::Symbol
: Selected activation function. Default: :gamma_activationmatch::Symbol
: Selected match function. Default: :gamma_matchupdate::Symbol
: Selected weight update function. Default: :basic_update
AdaptiveResonance.opts_SFAM
— Typemutable struct opts_SFAM <: ARTOpts
Summary
Implements a Simple Fuzzy ARTMAP learner's options.
These options are a Parameters.jl
struct, taking custom options keyword arguments. Each field has a default value listed below.
Fields
rho::Float64
: Vigilance parameter: rho ∈ [0, 1]. Default: 0.75alpha::Float64
: Choice parameter: alpha > 0. Default: 1.0e-7epsilon::Float64
: Match tracking parameter: epsilon ∈ (0, 1). Default: 0.001beta::Float64
: Learning parameter: beta ∈ (0, 1]. Default: 1.0max_epoch::Int64
: Maximum number of epochs during training: max_epoch ∈ [1, Inf). Default: 1display::Bool
: Display flag for progress bars. Default: falseuncommitted::Bool
: Flag to use an uncommitted node when learning.If true, new weights are created with ones(dim) and learn on the complement-coded sample. If false, fast-committing is used where the new weight is simply the complement-coded sample. Default: false
match::Symbol
: Selected match function. Default: :basic_matchactivation::Symbol
: Selected activation function. Default: :basic_activationupdate::Symbol
: Selected weight update function. Default: :basic_update
AdaptiveResonance.DAM
— MethodDAM(opts::opts_SFAM) -> SFAM
Summary
Implements a Default ARTMAP module with specified options.
Default ARTMAP is a variant of SFAM, using the AdaptiveResonance.opts_SFAM
options. This constructor sets the activation to :choice_by_difference
in addition to the keyword argument options you provide.
Arguments
opts::opts_SFAM
: the Simplified FuzzyARTMAP options (seeAdaptiveResonance.opts_SFAM
).
Method List / Definition Locations
DAM(opts)
AdaptiveResonance.DAM
— MethodDAM(; kwargs...) -> SFAM
Summary
Constructs a Default ARTMAP module using a SFAM module using Default ARTMAP's choice-by-difference activation function.
Default ARTMAP is a variant of SFAM, using the AdaptiveResonance.opts_SFAM
options. This constructor sets the activation to :choice_by_difference
in addition to the keyword argument options you provide.
Arguments
kwargs
: keyword arguments of Simplified FuzzyARTMAP options (seeAdaptiveResonance.opts_SFAM
)
References:
- G. P. Amis and G. A. Carpenter, 'Default ARTMAP 2,' IEEE Int. Conf. Neural Networks - Conf. Proc., vol. 2, no. September 2007, pp. 777-782, Mar. 2007, doi: 10.1109/IJCNN.2007.4371056.
Method List / Definition Locations
DAM(; kwargs...)
AdaptiveResonance.GammaNormalizedFuzzyART
— MethodGammaNormalizedFuzzyART(opts::opts_FuzzyART)
Summary
Implements a Gamma-Normalized FuzzyART module with specified options.
GammaNormalizedFuzzyART is a variant of FuzzyART
, using the AdaptiveResonance.opts_FuzzyART
options. This constructor passes gamma_normalization=true
, which internally uses match=:gamma_match
and activation=:gamma_activation
in addition to the keyword argument options you provide.
Arguments
opts::opts_FuzzyART
: the Fuzzy ART options (seeAdaptiveResonance.opts_FuzzyART
).
Method List / Definition Locations
GammaNormalizedFuzzyART(opts)
AdaptiveResonance.GammaNormalizedFuzzyART
— MethodGammaNormalizedFuzzyART(; kwargs...) -> FuzzyART
Summary
Constructs a Gamma-Normalized FuzzyART module as a variant of FuzzyART by using the gamma_normalization option.
GammaNormalizedFuzzyART is a variant of FuzzyART
, using the AdaptiveResonance.opts_FuzzyART
options. This constructor passes gamma_normalization=true
, which internally uses match=:gamma_match
and activation=:gamma_activation
in addition to the keyword argument options you provide.
Arguments
kwargs
: keyword arguments of FuzzyART options (seeAdaptiveResonance.opts_FuzzyART
)
Method List / Definition Locations
GammaNormalizedFuzzyART(; kwargs...)
AdaptiveResonance.W_norm
— MethodW_norm(W::AbstractVector{T} where T<:Real) -> Any
Summary
Low-level common function for computing the 1-norm of just the weight vector.
Arguments
W::RealVector
: the weight vector to use.
Method List / Definition Locations
W_norm(W)
AdaptiveResonance.accommodate_vector!
— Methodaccommodate_vector!(vec::Array{T, 1}, goal_len::Integer)
Summary
Extends a vector to a goal length with zeros of its element type to accommodate in-place updates.
Arguments
vec::Vector{T}
: a vector of arbitrary element type.goal_len::Integer
: the length that the vector should be.
Method List / Definition Locations
accommodate_vector!(vec, goal_len)
AdaptiveResonance.activation_match!
— Methodactivation_match!(
art::AdaptiveResonance.AbstractFuzzyART,
x::AbstractVector{T} where T<:Real
)
Summary
Computes the activation and match functions of the ART module against sample x.
Arguments
art::AbstractFuzzyART
: the single FuzzyART 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)
AdaptiveResonance.art_activation
— Methodart_activation(
art::ARTModule,
x::AbstractVector{T} where T<:Real,
index::Integer,
args...
) -> Any
Summary
Evaluates the activation function of the ART/ARTMAP module on the sample 'x' with weight 'W'.
Passes additional arguments for low-level optimizations using function dispatch.
Arguments
art::ARTModule
: the ARTModule module.x::RealVector
: the sample vector to use.index::Integer
: the index of the weight column to use.
Method List / Definition Locations
art_activation(art, x, index, args)
AdaptiveResonance.art_learn
— Methodart_learn(
art::ARTModule,
x::AbstractVector{T} where T<:Real,
index::Integer
) -> Any
Summary
Evaluates the ART module's learning/update method.
Arguments
art::ARTModule
: the ARTModule module.x::RealVector
: the sample vector to use.index::Integer
: the index of the weight column to use.
Method List / Definition Locations
art_learn(art, x, index)
AdaptiveResonance.art_match
— Methodart_match(
art::ARTModule,
x::AbstractVector{T} where T<:Real,
index::Integer,
args...
) -> Any
Summary
Evaluates the match function of the ART/ARTMAP module on sample 'x' with weight 'W'.
Passes additional arguments for low-level optimizations using function dispatch.
Arguments
art::ARTModule
: the ARTModule module.x::RealVector
: the sample vector to use.index::Integer
: the index of the weight column to use.
Method List / Definition Locations
art_match(art, x, index, args)
AdaptiveResonance.artscene_filter
— Methodartscene_filter(
raw_image::Array{T<:AbstractFloat, 3}
) -> Tuple{Array{Float64, 4}, Array{Float64, 3}}
Summary
Process the full artscene filter toolchain on an image.
Arguments
raw_image::Array{Real, 3}
: the raw RGB image to process with the ARTSCENE filter.
Method List / Definition Locations
artscene_filter(raw_image)
AdaptiveResonance.average
— Methodaverage(field::AbstractVector{T} where T<:Real) -> Any
Summary
Average linkage DDVFA similarity function.
Arguments
field::RealVector
: the DDVFA FuzzyART F2 node field (F2.T or F2.M) to compute the linkage for.
Method List / Definition Locations
average(field)
AdaptiveResonance.basic_activation
— Methodbasic_activation(
art::ARTModule,
x::AbstractVector{T} where T<:Real,
W::AbstractVector{T} where T<:Real
) -> Any
Summary
Simplified FuzzyARTMAP activation function.
Arguments
art::ARTModule
: the ARTModule module.x::RealVector
: the sample vector to use.W::RealVector
: the weight vector to use.
Method List / Definition Locations
basic_activation(art, x, W)
AdaptiveResonance.basic_match
— Methodbasic_match(
art::ARTModule,
x::AbstractVector{T} where T<:Real,
W::AbstractVector{T} where T<:Real
) -> Any
Summary
Basic match function.
Arguments
art::ARTModule
: the ARTModule module.x::RealVector
: the sample vector to use.W::RealVector
: the weight vector to use.
Method List / Definition Locations
basic_match(art, x, W)
AdaptiveResonance.basic_update
— Methodbasic_update(
art::ARTModule,
x::AbstractVector{T} where T<:Real,
W::AbstractVector{T} where T<:Real
) -> Any
Summary
Basic weight update function.
Arguments
art::ARTModule
: the ARTModule module.x::RealVector
: the sample vector to use.W::RealVector
: the weight vector to use.
Method List / Definition Locations
basic_update(art, x, W)
AdaptiveResonance.build_art_stats
— Methodbuild_art_stats() -> Dict{String, Any}
Summary
Initializes an ARTStats dictionary with zero entries.
Method List / Definition Locations
build_art_stats()
AdaptiveResonance.centroid
— Methodcentroid(
F2::FuzzyART,
sample::AbstractVector{T} where T<:Real,
activation::Bool
) -> Any
Summary
Centroid linkage DDVFA similarity function.
Arguments:
F2::FuzzyART
: the DDVFA FuzzyART F2 node to compute the linkage method within.sample::RealVector
: the sample to use for computing the linkage to the F2 module.activation::Bool
: flag to use the activation function. False uses the match function.
Method List / Definition Locations
centroid(F2, sample, activation)
AdaptiveResonance.choice_by_difference
— Methodchoice_by_difference(
art::ARTModule,
x::AbstractVector{T} where T<:Real,
W::AbstractVector{T} where T<:Real
) -> Any
Summary
Default ARTMAP's choice-by-difference activation function.
Arguments
art::ARTModule
: the ARTModule module.x::RealVector
: the sample vector to use.W::RealVector
: the weight vector to use.
Method List / Definition Locations
choice_by_difference(art, x, W)
AdaptiveResonance.classify
— Methodclassify(
art::ARTModule,
x::AbstractMatrix{T} where T<:Real;
preprocessed,
get_bmu
) -> Any
Summary
Predict categories of 'x' using the ART model.
Returns predicted categories 'y_hat.'
Arguments
art::ARTModule
: ART or ARTMAP module to use for batch inference.x::RealMatrix
: the 2-D dataset containing columns of samples with rows of features.preprocessed::Bool=false
: flag, if the data has already been complement coded or not.get_bmu::Bool=false
, flag, if the model should return the best-matching-unit label in the case of total mismatch.
Examples
julia> my_DDVFA = DDVFA()
DDVFA
opts: opts_DDVFA
...
julia> x, y = load_data()
julia> train!(my_DDVFA, x)
julia> y_hat = classify(my_DDVFA, y)
Method List / Definition Locations
classify(art, x; preprocessed, get_bmu)
AdaptiveResonance.classify
— MethodSummary
Predict categories of a single sample of features 'x' using the ART model.
Returns predicted category 'y_hat.'
Arguments
art::ARTModule
: ART or ARTMAP module to use for batch inference.x::RealVector
: the single sample of features to classify.preprocessed::Bool=false
: optional, flag if the data has already been complement coded or not.get_bmu::Bool=false
: optional, flag if the model should return the best-matching-unit label in the case of total mismatch.
Method List / Definition Locations
classify(art, x; preprocessed, get_bmu)
classify(art, x; preprocessed, get_bmu)
classify(art, x; preprocessed, get_bmu)
classify(art, x; preprocessed, get_bmu)
AdaptiveResonance.color_to_gray
— Methodcolor_to_gray(image::Array{T<:AbstractFloat, 3}) -> Matrix
Summary
ARTSCENE Stage 1: Color-to-gray image transformation.
Method List / Definition Locations
color_to_gray(image)
AdaptiveResonance.competition_kernel
— Methodcompetition_kernel(l::Integer, k::Integer; sign) -> Any
Summary
Competition kernel for ARTSCENE: Stage 5.
Method List / Definition Locations
competition_kernel(l, k; sign)
AdaptiveResonance.complement_code
— Methodcomplement_code(
data::AbstractArray{T} where T<:Real;
config
) -> Any
Summary
Normalizes the data x to [0, 1] and returns the augmented vector [x, 1 - x].
Arguments
data::RealArray
: the 1-D or 2-D data to be complement coded.config::DataConfig=DataConfig()
: the data configuration for the ART/ARTMAP module.
Method List / Definition Locations
complement_code(data; config)
AdaptiveResonance.complete
— Methodcomplete(field::AbstractVector{T} where T<:Real) -> Any
Summary
Complete linkage DDVFA similarity function.
Arguments
field::RealVector
: the DDVFA FuzzyART F2 node field (F2.T or F2.M) to compute the linkage for.
Method List / Definition Locations
complete(field)
AdaptiveResonance.contrast_insensitive_oriented_filtering
— Methodcontrast_insensitive_oriented_filtering(
y::AbstractArray{T} where T<:Real
) -> Any
Summary
ARTSCENE Stage 4: Contrast-insensitive oriented filtering.
Method List / Definition Locations
contrast_insensitive_oriented_filtering(y)
AdaptiveResonance.contrast_normalization
— Methodcontrast_normalization(
image::AbstractArray{T} where T<:Real
) -> Any
Summary
ARTSCENE Stage 2: Constrast normalization.
Method List / Definition Locations
contrast_normalization(image)
AdaptiveResonance.contrast_sensitive_oriented_filtering
— Methodcontrast_sensitive_oriented_filtering(
image::AbstractArray{T} where T<:Real,
x::AbstractArray{T} where T<:Real
) -> Any
Summary
ARTSCENE Stage 3: Contrast-sensitive oriented filtering.
Method List / Definition Locations
contrast_sensitive_oriented_filtering(image, x)
AdaptiveResonance.create_category!
— MethodSummary
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)
create_category!(art, x, y; new_cluster)
create_category!(art, x, y)
create_category!(art, x, y)
AdaptiveResonance.create_category!
— Methodcreate_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)
AdaptiveResonance.create_category!
— Methodcreate_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)
AdaptiveResonance.data_setup!
— Methoddata_setup!(
art::ARTModule,
data::AbstractMatrix{T} where T<:Real
)
Summary
Convenience method for setting up the DataConfig of an ART module in advance.
Arguments
art::ARTModule
: the ART/ARTMAP module to manually configure the data config for.data::RealArray
: the 2-D batch of data used to create the data config.
Method List / Definition Locations
data_setup!(art, data)
AdaptiveResonance.data_setup!
— Methoddata_setup!(
config::DataConfig,
data::AbstractMatrix{T} where T<:Real
)
Summary
Sets up the data config for the ART module before training.
This function crucially gets the original and complement-coded dimensions of the data, and it infers the bounds of the data (minimums and maximums) by the largest and smallest values along each feature dimension.
Arguments
config::DataConfig
: the ART/ARTMAP module's data configuration object.data::RealMatrix
: the 2-D batch of data to use for creating the data configuration.
Method List / Definition Locations
data_setup!(config, data)
AdaptiveResonance.ddt_x
— Methodddt_x(
x::AbstractArray{T} where T<:Real,
image::AbstractArray{T} where T<:Real,
sigma_s::AbstractArray{T} where T<:Real
) -> SharedArrays.SharedArray{Float64, 3}
Summary
Time rate of change of LGN network (ARTSCENE Stage 2).
Method List / Definition Locations
ddt_x(x, image, sigma_s)
AdaptiveResonance.ddt_y
— Methodddt_y(
y::AbstractArray{T} where T<:Real,
X_plus::AbstractArray{T} where T<:Real,
X_minus::AbstractArray{T} where T<:Real,
alpha::Real
) -> SharedArrays.SharedArray{Float64, 4}
Summary
Shunting equation for ARTSCENE Stage 3.
Method List / Definition Locations
ddt_y(y, X_plus, X_minus, alpha)
AdaptiveResonance.ddt_z
— Methodddt_z(
z::AbstractArray{T} where T<:Real
) -> SharedArrays.SharedArray{Float64, 4}
Summary
Time rate of change for ARTSCENE: Stage 5.
Method List / Definition Locations
ddt_z(z)
AdaptiveResonance.element_min
— Methodelement_min(
x::AbstractVector{T} where T<:Real,
W::AbstractVector{T} where T<:Real
) -> Any
Summary
Returns the element-wise minimum between sample x and weight W.
Arguments
x::RealVector
: the input sample.W::RealVector
: the weight vector to compare the sample against.
Method List / Definition Locations
element_min(x, W)
AdaptiveResonance.gamma_activation
— Methodgamma_activation(
art::ARTModule,
x::AbstractVector{T} where T<:Real,
W::AbstractVector{T} where T<:Real
) -> Any
Summary
Gamma-normalized activation funtion.
Arguments
art::ARTModule
: the ARTModule module.x::RealVector
: the sample vector to use.W::RealVector
: the weight vector to use.
Method List / Definition Locations
gamma_activation(art, x, W)
AdaptiveResonance.gamma_match
— Methodgamma_match(
art::ARTModule,
_::AbstractVector{T} where T<:Real,
W::AbstractVector{T} where T<:Real,
gamma_act::Real
) -> Any
Summary
Gamma-normalized match function, passing a precomputed gamma activation value.
Arguments
art::ARTModule
: the ARTModule module.x::RealVector
: the sample vector to use.W::RealVector
: the weight vector to use.
gamma_act::Real
: the precomputed gamma activation value.
Method List / Definition Locations
gamma_match(art, _, W, gamma_act)
AdaptiveResonance.gamma_match
— Methodgamma_match(
art::ARTModule,
x::AbstractVector{T} where T<:Real,
W::AbstractVector{T} where T<:Real
) -> Any
Summary
Gamma-normalized match function, recomputing the gamma activation value.
Arguments
art::ARTModule
: the ARTModule module.x::RealVector
: the sample vector to use.W::RealVector
: the weight vector to use.
Method List / Definition Locations
gamma_match(art, x, W)
AdaptiveResonance.gamma_match_sub
— Methodgamma_match_sub(
art::ARTModule,
W::AbstractVector{T} where T<:Real,
gamma_act::Real
) -> Any
Summary
Low-level subroutine for the gamma match function with a precomputed gamma activation.
Arguments
art::ARTModule
: the ARTModule module.W::RealVector
: the weight vector to use.gamma_act::Real
: the precomputed gamma activation value.
Method List / Definition Locations
gamma_match_sub(art, W, gamma_act)
AdaptiveResonance.get_W
— Methodget_W(art::DDVFA) -> Vector
Summary
Convenience function; return a concatenated array of all DDVFA weights.
Arguments
art::DDVFA
: the DDVFA module to get all of the weights from as a list.
Method List / Definition Locations
get_W(art)
AdaptiveResonance.get_data_characteristics
— Methodget_data_characteristics(
data::AbstractMatrix{T} where T<:Real;
config
) -> NTuple{4, Any}
Summary
Get the characteristics of the data, taking account if a data config is passed.
If no DataConfig is passed, then the data characteristics come from the array itself. Otherwise, use the config for the statistics of the data and the data array for the number of samples.
Arguments
data::RealMatrix
: the 2-D data to be complement coded.config::DataConfig=DataConfig()
: the data configuration for the ART/ARTMAP module.
Method List / Definition Locations
get_data_characteristics(data; config)
AdaptiveResonance.get_data_shape
— Methodget_data_shape(
data::AbstractMatrix{T} where T<:Real
) -> Tuple{Any, Any}
Summary
Returns the (dim, n_samples) of the provided 2-D data matrix, enforcing the ART package convention.
Arguments
data::RealMatrix
: the 2-D data to infer the feature dimension and number of samples from.
Method List / Definition Locations
get_data_shape(data)
AdaptiveResonance.get_dim
— Methodget_dim(data::AbstractMatrix{T} where T<:Real) -> Any
Summary
Returns the dimension of the data, enforcint the (dim, n_samples) convention of the package.
Arguments
data::RealMatrix
: the 2-D data to infer the feature dimension of.
Method List / Definition Locations
get_dim(data)
AdaptiveResonance.get_iterator
— Methodget_iterator(opts::ARTOpts, n_samples::Integer) -> Any
Summary
Creates an iterator object according to the ART/ARTMAP modules display settings for batch iteration.
Arguments
opts::ARTOpts
: the ART/ARTMAP module's options containing display settings.n_samples::Integer
: the number of iterations to create the iterator for.
Method List / Definition Locations
get_iterator(opts, n_samples)
AdaptiveResonance.get_n_samples
— Methodget_n_samples(data::AbstractMatrix{T} where T<:Real) -> Any
Summary
Returns the number of samples, enforcing the convention of the package.
Arguments
data::RealMatrix
: the 2-D data to infer the number of samples from.
Method List / Definition Locations
get_n_samples(data)
AdaptiveResonance.get_n_weights
— Methodget_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)
AdaptiveResonance.get_n_weights_vec
— Methodget_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)
AdaptiveResonance.get_sample
— Methodget_sample(
x::AbstractMatrix{T} where T<:Real,
i::Integer
) -> Any
Summary
Returns a sample from data array x
at sample location i
. This function implements the convention that columns are samples while rows are features within samples.
Arguments
x::RealMatrix
: the batch of data to grab a sample from.i::Integer
: the index to get the sample from.
Method List / Definition Locations
get_sample(x, i)
AdaptiveResonance.init_classify!
— Methodinit_classify!(
x::AbstractArray{T} where T<:Real,
art::ARTModule,
preprocessed::Bool
) -> Any
Summary
Initializes the classification loop for batch inference.
Arguments
x::RealArray
: the data that is used for inference.art::ARTModule
: the ART/ARTMAP module that will be used for inference.preprocessed::Bool
: required flag for if the data has already been complement coded and normalized.
Method List / Definition Locations
init_classify!(x, art, preprocessed)
AdaptiveResonance.init_train!
— Methodinit_train!(
x::AbstractMatrix{T} where T<:Real,
art::ARTModule,
preprocessed::Bool
) -> Any
Summary
Initializes the training loop for batch learning.
Arguments
x::RealMatrix
: the data that is used for training.art::ARTModule
: the ART/ARTMAP that will be trained.preprocessed::Bool
: required flag for if the data has already been complement coded and normalized.
Method List / Definition Locations
init_train!(x, art, preprocessed)
AdaptiveResonance.init_train!
— Methodinit_train!(
x::AbstractVector{T} where T<:Real,
art::ARTModule,
preprocessed::Bool
) -> AbstractVector{T} where T<:Real
Summary
Initializes the module for training in a single iteration.
The purpose of this function is mainly to handle the conditions of complement coding. Fails if the module was incorrectly set up or if the module was not setup and the data was not preprocessed.
Arguments
x::RealVector
: the sample used for initialization.art::ARTModule
: the ART/ARTMAP module that will be trained on the sample.preprocessed::Bool
: a required flag for if the sample has already been complement coded and normalized.
Method List / Definition Locations
init_train!(x, art, preprocessed)
AdaptiveResonance.initialize!
— MethodSummary
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) ```
AdaptiveResonance.initialize!
— MethodSummary
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) ```
AdaptiveResonance.learn!
— Methodlearn!(
art::AdaptiveResonance.AbstractFuzzyART,
x::AbstractVector{T} where T<:Real,
index::Integer
)
Summary
In place learning function.
Arguments
art::AbstractFuzzyART
: the FuzzyART module to update.x::RealVector
: the sample to learn from.index::Integer
: the index of the FuzzyART weight to update.
Method List / Definition Locations
learn!(art, x, index)
AdaptiveResonance.learn!
— Methodlearn!(
art::SFAM,
x::AbstractVector{T} where T<:Real,
index::Integer
)
Summary
In-place learning function.
Method List / Definition Locations
learn!(art, x, index)
AdaptiveResonance.linear_normalization
— Methodlinear_normalization(
data::AbstractMatrix{T} where T<:Real;
config
) -> Any
Summary
Normalize the data to the range [0, 1] along each feature.
Arguments
data::RealMatrix
: the 2-D batch of data to normalize.config::DataConfig=DataConfig()
: the data configuration from the ART/ARTMAP module.
Method List / Definition Locations
linear_normalization(data; config)
AdaptiveResonance.linear_normalization
— Methodlinear_normalization(
data::AbstractVector{T} where T<:Real;
config
) -> Vector{Float64}
Summary
Normalize the data to the range [0, 1] along each feature.
Arguments
data::RealVector
: the 1-D sample of data to normalize.config::DataConfig=DataConfig()
: the data configuration from the ART/ARTMAP module.
Method List / Definition Locations
linear_normalization(data; config)
AdaptiveResonance.log_art_stats!
— Methodlog_art_stats!(art::ARTModule, bmu::Integer, mismatch::Bool)
Summary
Logs common statistics of an ART module after a training/classification iteration.
Arguments
art::ARTModule
: the ART module that just underwent training/classification.bmu::Integer
: the best-matching unit integer index.mismatch::Bool
: flag of whether there was a mismatch in this iteration.
Method List / Definition Locations
log_art_stats!(art, bmu, mismatch)
AdaptiveResonance.median
— Methodmedian(field::AbstractVector{T} where T<:Real) -> Any
Summary
Median linkage DDVFA similarity function.
Arguments
field::RealVector
: the DDVFA FuzzyART F2 node field (F2.T or F2.M) to compute the linkage for.
Method List / Definition Locations
median(field)
AdaptiveResonance.opts_DAM
— Methodopts_DAM(; kwargs...) -> opts_SFAM
Summary
Implements a Default ARTMAP module's options.
Default ARTMAP is a variant of SFAM, using the AdaptiveResonance.opts_SFAM
options. This constructor sets the activation to :choice_by_difference
in addition to the keyword argument options you provide.
These options are a Parameters.jl
struct, taking custom options keyword arguments. Each field has a default value listed below.
Method List / Definition Locations
opts_DAM(; kwargs...)
AdaptiveResonance.opts_GammaNormalizedFuzzyART
— Methodopts_GammaNormalizedFuzzyART(; kwargs...)
Summary
Implements a Gamma-Normalized FuzzyART module's options.
GammaNormalizedFuzzyART is a variant of FuzzyART
, using the AdaptiveResonance.opts_FuzzyART
options. This constructor passes gamma_normalization=true
, which internally uses match=:gamma_match
and activation=:gamma_activation
in addition to the keyword argument options you provide.
These options are a Parameters.jl
struct, taking custom options keyword arguments. Each field has a default value listed below.
Method List / Definition Locations
opts_GammaNormalizedFuzzyART(; kwargs...)
AdaptiveResonance.orientation_competition
— Methodorientation_competition(
z::AbstractArray{T} where T<:Real
) -> Any
Summary
ARTSCENE Stage 5: Orientation competition at the same position.
Method List / Definition Locations
orientation_competition(z)
AdaptiveResonance.oriented_kernel
— Methodoriented_kernel(
i::Integer,
j::Integer,
p::Integer,
q::Integer,
k::Integer,
sigma_h::Real,
sigma_v::Real;
sign
) -> Any
Summary
Oriented, elongated, spatially offset kernel G for ARTSCENE Stage 3.
Method List / Definition Locations
oriented_kernel(i, j, p, q, k, sigma_h, sigma_v; sign)
AdaptiveResonance.patch_orientation_color
— Methodpatch_orientation_color(
z::AbstractArray{T} where T<:Real,
image::AbstractArray{T} where T<:Real
) -> Tuple{Array{Float64, 4}, Array{Float64, 3}}
Summary
ARTSCENE Stage 6: Create patch feature vectors.
Method List / Definition Locations
patch_orientation_color(z, image)
AdaptiveResonance.performance
— Methodperformance(
y_hat::AbstractVector{T} where T<:Integer,
y::AbstractVector{T} where T<:Integer
) -> Any
Summary
Convenience function to get the categorization performance of y_hat against y.
Arguments
y_hat::IntegerVector
: the estimated labels.y::IntegerVector
: the true labels.
Method List / Definition Locations
performance(y_hat, y)
AdaptiveResonance.replace_mat_index!
— Methodreplace_mat_index!(
mat::AbstractMatrix{T} where T<:Real,
vec::AbstractVector{T} where T<:Real,
index::Integer
) -> AbstractVector{T} where T<:Real
Summary
Replaces a matrix element with a vector at the column index.
This function dispatches to the low-level replacement strategy.
Arguments
mat::RealMatrix
: the matrix to update with a replaced column vector.vec::RealVector
: the vector to put in the matrix at the column index.index::Integer
: the column index to put the vector.
Method List / Definition Locations
replace_mat_index!(mat, vec, index)
AdaptiveResonance.set_threshold!
— MethodSummary
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)
set_threshold!(art)
set_threshold!(art)
AdaptiveResonance.similarity
— Methodsimilarity(
method::Symbol,
F2::FuzzyART,
sample::AbstractVector{T} where T<:Real,
activation::Bool
) -> Any
Summary
Compute the similarity metric depending on method with explicit comparisons for the field name.
Arguments
method::Symbol
: the linkage method to use.F2::FuzzyART
: the DDVFA FuzzyART F2 node to compute the linkage method within.sample::RealVector
: the sample to use for computing the linkage to the F2 module.activation::Bool
: flag to use the activation function. False uses the match function.
Method List / Definition Locations
similarity(method, F2, sample, activation)
AdaptiveResonance.single
— Methodsingle(field::AbstractVector{T} where T<:Real) -> Any
Summary
Single linkage DDVFA similarity function.
Arguments
field::RealVector
: the DDVFA FuzzyART F2 node field (F2.T or F2.M) to compute the linkage for.
Method List / Definition Locations
single(field)
AdaptiveResonance.stopping_conditions
— Methodstopping_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)
AdaptiveResonance.surround_kernel
— Methodsurround_kernel(
i::Integer,
j::Integer,
p::Integer,
q::Integer,
scale::Integer
) -> Any
Summary
Surround kernel S function for ARTSCENE Stage 2.
Method List / Definition Locations
surround_kernel(i, j, p, q, scale)
AdaptiveResonance.train!
— Functiontrain!(
art::ARTMAP,
x::AbstractMatrix{T} where T<:Real,
y::AbstractVector{T} where T<:Integer
) -> Any
train!(
art::ARTMAP,
x::AbstractMatrix{T} where T<:Real,
y::AbstractVector{T} where T<:Integer,
preprocessed::Bool
) -> Any
Summary
train!(art::ARTMAP, x::RealMatrix, y::IntegerVector, preprocessed::Bool=false)
Train the ARTMAP model on a batch of data 'x' with supervisory labels 'y.'
Arguments
art::ARTMAP
: the supervised ARTMAP model to train.x::RealMatrix
: the 2-D dataset containing columns of samples with rows of features.y::IntegerVector
: labels for supervisory training.preprocessed::Bool=false
: flag, if the data has already been complement coded or not.
Method List / Definition Locations
train!(art, x, y)
train!(art, x, y, preprocessed)
AdaptiveResonance.train!
— Methodtrain!(
art::ART,
x::AbstractMatrix{T} where T<:Real;
y,
preprocessed
) -> Any
Summary
Train the ART model on a batch of data 'x' with optional supervisory labels 'y.'
Arguments
art::ART
: the unsupervised ART model to train.x::RealMatrix
: the 2-D dataset containing columns of samples with rows of features.y::IntegerVector=Int[]
: optional, labels for simple supervisory training.preprocessed::Bool=false
: optional, flag if the data has already been complement coded or not.
Method List / Definition Locations
train!(art, x; y, preprocessed)
AdaptiveResonance.train!
— MethodSummary
Train the ART model on a single sample of features 'x' with an optional supervisory label.
Arguments
art::ART
: the unsupervised ART model to train.x::RealVector
: the single sample feature vector to train upon.y::Integer=0
: optional, a label for simple supervisory training.preprocessed::Bool=false
: optional, flag if the data has already been complement coded or not.
Method List / Definition Locations
train!(art, x; y, preprocessed)
train!(art, x; y, preprocessed)
train!(art, x; y, preprocessed)
AdaptiveResonance.train!
— MethodSummary
Train the supervised ARTMAP model on a single sample of features 'x' with supervisory label 'y'.
Arguments
art::ARTMAP
: the supervised ART model to train.x::RealVector
: the single sample feature vector to train upon.y::Integer
: the label for supervisory training.preprocessed::Bool=false
: optional, flag if the data has already been complement coded or not.
Method List / Definition Locations
train!(art, x, y; preprocessed)
AdaptiveResonance.unnormalized_match
— Methodunnormalized_match(
_::ARTModule,
x::AbstractVector{T} where T<:Real,
W::AbstractVector{T} where T<:Real
) -> Any
Summary
Unnormalized match function.
Arguments
art::ARTModule
: the ARTModule module.x::RealVector
: the sample vector to use.W::RealVector
: the weight vector to use.
Method List / Definition Locations
unnormalized_match(_, x, W)
AdaptiveResonance.unsafe_replace_mat_index!
— Methodunsafe_replace_mat_index!(
mat::AbstractMatrix{T} where T<:Real,
vec::AbstractVector{T} where T<:Real,
index::Integer
) -> AbstractVector{T} where T<:Real
Summary
Low-level function for unsafely replacing a matrix column with a given vector.
Arguments
mat::RealMatrix
: the matrix to update with a replaced column vector.vec::RealVector
: the vector to put in the matrix at the column index.index::Integer
: the column index to put the vector.
Method List / Definition Locations
unsafe_replace_mat_index!(mat, vec, index)
AdaptiveResonance.update_iter
— Methodupdate_iter(
art::ARTModule,
iter::Union{ProgressBars.ProgressBar, UnitRange},
i::Integer
) -> Union{Nothing, String}
Summary
Updates the iteration of the ART/ARTMAP module, training or inference, according to its display settings.
Arguments
art::ARTModule
: the ART/ARTMAP module being iterated upon.iter::ARTIterator
: the iterator object used in the training/inference loop.i::Integer
: the iteration during training/inference that the iterator should be updated to.
Method List / Definition Locations
update_iter(art, iter, i)
AdaptiveResonance.weighted
— Methodweighted(F2::FuzzyART, activation::Bool) -> Float64
Summary
Weighted linkage DDVFA similarity function.
Arguments:
F2::FuzzyART
: the DDVFA FuzzyART F2 node to compute the linkage method within.activation::Bool
: flag to use the activation function. False uses the match function.
Method List / Definition Locations
weighted(F2, activation)
AdaptiveResonance.x_W_min_norm
— Methodx_W_min_norm(
x::AbstractVector{T} where T<:Real,
W::AbstractVector{T} where T<:Real
) -> Any
Summary
Low-level common function for computing the 1-norm of the element minimum of a sample and weights.
Arguments
x::RealVector
: the sample vector to use.W::RealVector
: the weight vector to use.
Method List / Definition Locations
x_W_min_norm(x, W)