Skip to content

Commit

Permalink
empty teleporting early break
Browse files Browse the repository at this point in the history
  • Loading branch information
guo-yong-zhi committed Jul 4, 2021
1 parent 98c8dec commit 4e7b6d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 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.3.7"
version = "0.3.8"

[deps]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
16 changes: 8 additions & 8 deletions src/train.jl
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ function train!(ts, nepoch::Number=-1, args...;
nc_min_t = typemax(Int)
count_g = 0
nc_min_g = typemax(Int)
teleport_count = 0
teleport_count = 0.
last_cinds = nothing
resource = trainer(inputs=ts)
collpool = nothing
Expand Down Expand Up @@ -528,14 +528,14 @@ function train!(ts, nepoch::Number=-1, args...;
if length(cinds) > 0
nc_min_t = typemax(nc_min_t)
reset!.(optimiser, ts[cinds])
cinds_set = Set(cinds)
if last_cinds == cinds_set
teleport_count += 1
else
teleport_count = 0
end
last_cinds = cinds_set
end
cinds_set = Set(cinds)
if last_cinds == cinds_set
teleport_count += length(cinds_set) > 0 ? 1 : 0.5
else
teleport_count = 0.
end
last_cinds = cinds_set
end
if ep%callbackstep == 0
callbackfun(ep)
Expand Down

2 comments on commit 4e7b6d5

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

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.8 -m "<description of version>" 4e7b6d5e9a2d42dda6191b0c924b06104bd13e64
git push origin v0.3.8

Please sign in to comment.