From bb4d5f60850b614b66cafd9c7913a25f4c7fd13b Mon Sep 17 00:00:00 2001 From: Antonello Lobianco Date: Mon, 2 Oct 2023 06:52:58 +0200 Subject: [PATCH] Updated API for ProgressMeter >= 1.8 --- Project.toml | 2 +- src/Nn/Nn.jl | 2 +- src/Perceptron/Perceptron_kernel.jl | 2 +- src/Perceptron/Perceptron_pegasos.jl | 2 +- src/Precompilation.jl | 4 +++- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 275cc58e..3cc9a860 100644 --- a/Project.toml +++ b/Project.toml @@ -41,7 +41,7 @@ LoopVectorization = "0.12" MLJModelInterface = "1.3.3" PDMats = "0.9, 0.10, 0.11" PrecompileTools = "1" -ProgressMeter = "1.3" +ProgressMeter = "1.8" Reexport = "0.2, 1.0" StableRNGs = "1.0" StaticArrays = "1" diff --git a/src/Nn/Nn.jl b/src/Nn/Nn.jl index 56d6fc9a..8d8f08c2 100644 --- a/src/Nn/Nn.jl +++ b/src/Nn/Nn.jl @@ -650,7 +650,7 @@ function train!(nn::NN,x,y; epochs=100, batch_size=min(size(x,1),32), sequential showTime = 0.2 end - @showprogress showTime "Training the Neural Network..." for t in 1:epochs + @showprogress dt=showTime desc="Training the Neural Network..." for t in 1:epochs batches = batch(n,batch_size,sequential=sequential,rng=rng) n_batches = length(batches) #if t == 1 # removed otherwise the array of losses/pars would be nepochs+1 diff --git a/src/Perceptron/Perceptron_kernel.jl b/src/Perceptron/Perceptron_kernel.jl index 8542ca0d..aa248fee 100644 --- a/src/Perceptron/Perceptron_kernel.jl +++ b/src/Perceptron/Perceptron_kernel.jl @@ -153,7 +153,7 @@ function kernelPerceptronBinary(x, y; K=radial_kernel, T=1000, α=zeros(Int64,le showTime = 0.2 end - @showprogress showTime "Training Kernel Perceptron..." for t in 1:T + @showprogress dt=showTime desc="Training Kernel Perceptron..." for t in 1:T ϵ = 0 if shuffle # random shuffle x, y and alpha diff --git a/src/Perceptron/Perceptron_pegasos.jl b/src/Perceptron/Perceptron_pegasos.jl index 558cd050..cb22742b 100644 --- a/src/Perceptron/Perceptron_pegasos.jl +++ b/src/Perceptron/Perceptron_pegasos.jl @@ -157,7 +157,7 @@ function pegasosBinary(x, y; θ=zeros(size(x,2)),θ₀=0.0, λ=0.5,η= (t -> 1/s lastϵ = Inf if force_origin θ₀ = 0.0; end sumθ = θ; sumθ₀ = θ₀ - @showprogress 1 "Training PegasosClassifier..." for t in 1:T + @showprogress dt=1 desc="Training PegasosClassifier..." for t in 1:T ϵ = 0 ηₜ = η(t) if shuffle diff --git a/src/Precompilation.jl b/src/Precompilation.jl index 89fe9060..eafa1c61 100644 --- a/src/Precompilation.jl +++ b/src/Precompilation.jl @@ -7,6 +7,7 @@ @compile_workload begin # all calls in this block will be precompiled, regardless of whether # they belong to your package or not (on Julia 1.8 and higher) + @info "Beginning BetaML PrecompileTool workflow...." yoh = fit!(OneHotEncoder(verbosity=NONE),ycat) fit!(NeuralNetworkEstimator(verbosity=NONE,epochs=10),x,y) fit!(NeuralNetworkEstimator(verbosity=NONE,epochs=10),x,yoh) @@ -18,5 +19,6 @@ fit!(KMeansClusterer(verbosity=NONE),x) fit!(KMedoidsClusterer(verbosity=NONE),x) fit!(GMMClusterer(verbosity=NONE,tol=0.01),x) + @info "...done BetaML PrecompileTool workflow." end -end \ No newline at end of file +end