Skip to content

Commit

Permalink
Changed zeros to undef matrix (addresses #26)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewilliami committed Oct 27, 2020
1 parent 993cb19 commit 37a1c00
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/AdaBoost.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ function learn(

# create an empty array (of zeroes) with dimensions (num_imgs, numFeautures)
# votes = zeros((num_imgs, num_features)) # necessarily different from `zero.((num_imgs, num_features))`; previously zerosarray
votes = zeros(num_imgs, num_features)
# votes = zeros(num_imgs, num_features)
votes = Matrix{Union{Missing, Int8}}(undef, num_imgs, num_features)
num_processed = 0

notify_user("Loading images ($(num_pos) positive and $(num_neg) negative images) and calculating their scores...")
Expand Down Expand Up @@ -136,7 +137,8 @@ function learn(
classifiers = []
p = Progress(num_classifiers, 1)
Base.Threads.@threads for t in 1:num_classifiers
classification_errors = zeros(length(feature_indices))
# classification_errors = zeros(length(feature_indices))
classification_errors = Matrix{Float64}(undef, length(feature_indices), 1)
# normalize the weights $w_{t,i}\gets \frac{w_{t,i}}{\sum_{j=1}^n w_{t,j}}$
weights = float(weights) / sum(weights)

Expand Down

0 comments on commit 37a1c00

Please sign in to comment.