Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Jul 25, 2024
1 parent b24f2ad commit 2b19b17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/algorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ function distance(
if length(starting_states) == 0
return Inf
end
return minimum(norm.(starting_states, Ref(state)))
return minimum(norm.(starting_states, Ref(state)); init = Inf)
end

# Internal function: the norm to use when checking the distance between two
Expand Down Expand Up @@ -1170,9 +1170,9 @@ function train(
status = master_loop(parallel_scheme, model, options)
catch ex
# Unwrap exceptions from tasks. If there are multiple exceptions,
# rethrow only the first one.
# rethrow only the last one.
if ex isa CompositeException
ex = first(ex.exceptions)
ex = last(ex.exceptions)
end
if ex isa TaskFailedException
ex = ex.task.exception
Expand All @@ -1182,7 +1182,7 @@ function train(
interrupt(parallel_scheme)
else
close(log_file_handle)
rethrow(ex)
throw(ex)
end
finally
# And close the dashboard callback if necessary.
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/forward_passes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function forward_pass(
# incoming state is more than δ away from the other states, add it
# as a possible starting state.
if distance(starting_states, incoming_state_value) >
options.cycle_discretization_delta
options.cycle_discretization_delta
push!(starting_states, incoming_state_value)
end
# TODO(odow):
Expand Down

0 comments on commit 2b19b17

Please sign in to comment.