Skip to content

Commit

Permalink
Hotfix type edge case in DDVFA, bump
Browse files Browse the repository at this point in the history
  • Loading branch information
AP6YC committed Jul 8, 2021
1 parent e870445 commit 63ba5e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "AdaptiveResonance"
uuid = "3d72adc0-63d3-4141-bf9b-84450dd0395b"
authors = ["Sasha Petrenko"]
description = "A Julia package for Adaptive Resonance Theory (ART) algorithms."
version = "0.3.2"
version = "0.3.3"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down
8 changes: 4 additions & 4 deletions src/ART/DDVFA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ GNFA
julia> initialize!(my_GNFA, [1 2 3 4])
```
"""
function initialize!(art::GNFA, x::RealArray ; y::Integer=0)
# function initialize!(art::GNFA, x::RealArray ; y::Integer=0)
function initialize!(art::GNFA, x::Vector{T} ; y::Integer=0) where {T<:RealFP}
# Set up the data config
if art.config.setup
@warn "Data configuration already set up, overwriting config"
Expand All @@ -160,7 +161,7 @@ function initialize!(art::GNFA, x::RealArray ; y::Integer=0)
# Set the threshold
art.threshold = art.opts.rho * (art.config.dim^art.opts.gamma_ref)
# Fast commit the weight
art.W = Array{RealFP}(undef, art.config.dim_comp, 1)
art.W = Array{T}(undef, art.config.dim_comp, 1)
# Assign the contents, valid this way for 1-D or 2-D arrays
art.W[:, 1] = x
label = y == 0 ? y : 1
Expand Down Expand Up @@ -531,8 +532,7 @@ function train!(art::DDVFA, x::RealArray ; y::IntegerVector = Vector{Integer}(),
end

# Initialize old weight vector for checking stopping conditions between epochs
art.W_old = Array{RealFP}(undef, art.config.dim_comp, 1)
art.W_old[:, 1] = get_sample(x, 1)
art.W_old = deepcopy(art.W)

# Set the learning threshold as a function of the data dimension
art.threshold = art.opts.rho*(art.config.dim^art.opts.gamma_ref)
Expand Down

2 comments on commit 63ba5e1

@AP6YC
Copy link
Owner Author

@AP6YC AP6YC commented on 63ba5e1 Jul 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

Hotfix a type edge case where input data loaded as abstract floats for DDVFA would break low-level linear algebra functions.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/40595

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.3 -m "<description of version>" 63ba5e1628921610141e3ea3416159bfb84f4fcb
git push origin v0.3.3

Please sign in to comment.