diff --git a/src/algorithm.jl b/src/algorithm.jl index dd3ded01c..abb4034a0 100644 --- a/src/algorithm.jl +++ b/src/algorithm.jl @@ -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 @@ -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 @@ -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. diff --git a/src/plugins/forward_passes.jl b/src/plugins/forward_passes.jl index a56ae65b5..5b528c19d 100644 --- a/src/plugins/forward_passes.jl +++ b/src/plugins/forward_passes.jl @@ -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):