Skip to content

Commit

Permalink
do not show info messages by default
Browse files Browse the repository at this point in the history
  • Loading branch information
guo-yong-zhi committed Apr 14, 2023
1 parent 4fd41da commit 0f764aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Stuffing"
uuid = "4175e07e-e5b7-423e-8796-3ea7f6d48281"
authors = ["guoyongzhi <[email protected]>"]
version = "0.8.5"
version = "0.8.6"

[deps]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
4 changes: 2 additions & 2 deletions src/Stuffing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using .QTrees
using .Trainer
include("utils.jl")

@info "Threads.nthreads() = $(Threads.nthreads())"
@debug "Threads.nthreads() = $(Threads.nthreads())"

function qtree(pic::AbstractMatrix{UInt8}, args...)
qt = ShiftedQTree(pic, args..., default=QTrees.EMPTY) |> buildqtree!
Expand Down Expand Up @@ -106,7 +106,7 @@ end
function packing!(qts, args...; kargs...)
place!(qts)
nepoch, ncollection = fit!(qts, args...; kargs...)
@info "$nepoch epochs, $ncollection collections"
@debug "$nepoch epochs, $ncollection collections"
if ncollection != 0
colllist = first.(totalcollisions(qts))
get_text(i) = i > 1 ? "obj_$(i - 1)" : "#MASK#"
Expand Down
20 changes: 10 additions & 10 deletions src/fit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ function trainepoch_Px!(qtrees::AbstractVector{<:ShiftedQTree};
nc = filttrain!(qtrees, inpool, outpool, outlevel, optimiser=optimiser; kargs...)
if first(levelpools[1]) < -length(qtrees[1]) + 2
r = outpool !== nothing ? length(outpool) / length(inpool) : 1
# @info string(niter, "#"^(-first(levelpools[1])), "$(first(levelpools[1])) pool:$(length(inpool))($r) nc:$nc ")
# @debug string(niter, "#"^(-first(levelpools[1])), "$(first(levelpools[1])) pool:$(length(inpool))($r) nc:$nc ")
end
if (nc == 0) break end
# if (nc < last_nc) last_nc = nc else break end
Expand Down Expand Up @@ -418,7 +418,7 @@ function reposition!(ts, colist=nothing, args...; kargs...)
outlabels = outofkernelbounds(maskqt, ts[2:end]) .+ 1
if !isempty(outlabels)
place!(deepcopy(maskqt), ts, outlabels)
@info "$outlabels are out of bounds"
@debug "$outlabels are out of bounds"
return outlabels
end
if colist !== nothing
Expand Down Expand Up @@ -479,7 +479,7 @@ function train!(ts, nepoch::Number=-1, args...;
colist = resource[:levelpools][end] |> last
end
nepoch >= 0 || (nepoch = trainer(:nepoch))
@info "nepoch: $nepoch, " * (reposition_flag ? "patient: $patient" : "reposition off")
@debug "nepoch: $nepoch, " * (reposition_flag ? "patient: $patient" : "reposition off")
updated = get(resource, :updated, nothing)
while ep < nepoch
callback_pre(ep)
Expand All @@ -491,7 +491,7 @@ function train!(ts, nepoch::Number=-1, args...;
if nc != 0 && reposition_flag && length(ts) / 20 > length(colist) > 0 && patient > 0 && (indi_r.age >= patient || indi_r.age > length(colist)) # 超出耐心或少数几个碰撞
force = reposition_count>=2
repositioned = reposition!(ts, colist, from=from, force=force)
@info "@epoch $ep(+$(indi_r.age)), $nc($(length(colist))) collisions, reposition " *
@debug "@epoch $ep(+$(indi_r.age)), $nc($(length(colist))) collisions, reposition " *
(length(repositioned) > 0 ? "$repositioned to $(getshift.(ts[repositioned]))" : "nothing") * (force ? " (forced)" : "")
if length(repositioned) > 0
reset!(indi_r)
Expand All @@ -507,11 +507,11 @@ function train!(ts, nepoch::Number=-1, args...;
last_repositioned = repositioned_set
if reposition_count >= 1
if reposition_count >= 10
@info "The repositioning strategy failed after $ep epochs"
@debug "The repositioning strategy failed after $ep epochs"
break
end
moved = randommove!(ts, colist)
@info "@epoch $ep, random move $(length(moved)>0 ? moved : "nothing")"
@debug "@epoch $ep, random move $(length(moved)>0 ? moved : "nothing")"
end
end
callback(ep)
Expand All @@ -521,7 +521,7 @@ function train!(ts, nepoch::Number=-1, args...;
if outlen == 0
break
else
@info "$outlabels out of bounds"
@debug "$outlabels out of bounds"
nc += outlen
updated !== nothing && union!(updated, outlabels)
end
Expand All @@ -531,16 +531,16 @@ function train!(ts, nepoch::Number=-1, args...;
_eta = eta(optimiser)
push!(eta_list, (_eta, indi_s.min))
eta!(optimiser, scheduler(_eta))
@info "@epoch $ep(+$(indi_s.age)) η -> $(round(eta(optimiser), digits=3)) (current $nc collisions, best $(indi_s.min) collisions)"
@debug "@epoch $ep(+$(indi_s.age)) η -> $(round(eta(optimiser), digits=3)) (current $nc collisions, best $(indi_s.min) collisions)"
else
last_eta, last_nc = pop!(eta_list)
eta!(optimiser, last_eta)
@info "@epoch $ep(+$(indi_s.age)) η <- $(round(eta(optimiser), digits=3)) (collisions $(indi_s.min)$(last_nc))"
@debug "@epoch $ep(+$(indi_s.age)) η <- $(round(eta(optimiser), digits=3)) (collisions $(indi_s.min)$(last_nc))"
end
reset!(indi_s)
end
if indi_g.age > max(2, 2patient, nepoch / 50 * max(1, (length(ts) / indi_g.min)))
@info "training early break after $ep(+$(indi_g.age)) epochs (current $nc collisions, best $(indi_g.min) collisions)"
@debug "training early break after $ep(+$(indi_g.age)) epochs (current $nc collisions, best $(indi_g.min) collisions)"
break
end
end
Expand Down

2 comments on commit 0f764aa

@guo-yong-zhi
Copy link
Owner Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@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/81665

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.8.6 -m "<description of version>" 0f764aa6b8597eb686d14a3021719454884a83a5
git push origin v0.8.6

Please sign in to comment.