@@ -288,9 +288,8 @@ function update_message(
288288 message_update_alg:: Algorithm ,
289289 bpc:: AbstractBeliefPropagationCache ,
290290 edge:: PartitionEdge ;
291- kwargs... ,
292291)
293- return set_message (bpc, edge, updated_message (message_update_alg, bpc, edge; kwargs ... ))
292+ return set_message (bpc, edge, updated_message (message_update_alg, bpc, edge))
294293end
295294
296295"""
@@ -301,12 +300,11 @@ function update_one_iteration(
301300 bpc:: AbstractBeliefPropagationCache ,
302301 edges:: Vector ;
303302 (update_diff!)= nothing ,
304- kwargs... ,
305303)
306304 bpc = copy (bpc)
307305 for e in edges
308306 prev_message = ! isnothing (update_diff!) ? message (bpc, e) : nothing
309- bpc = update_message (alg. kwargs. message_update_alg, bpc, e; kwargs ... )
307+ bpc = update_message (alg. kwargs. message_update_alg, bpc, e)
310308 if ! isnothing (update_diff!)
311309 update_diff![] += message_diff (message (bpc, e), prev_message)
312310 end
@@ -323,11 +321,10 @@ function update_one_iteration(
323321 alg:: Algorithm ,
324322 bpc:: AbstractBeliefPropagationCache ,
325323 edge_groups:: Vector{<:Vector{<:PartitionEdge}} ;
326- kwargs... ,
327324)
328325 new_mts = empty (messages (bpc))
329326 for edges in edge_groups
330- bpc_t = update_one_iteration (alg. kwargs. message_update_alg, bpc, edges; kwargs ... )
327+ bpc_t = update_one_iteration (alg. kwargs. message_update_alg, bpc, edges)
331328 for e in edges
332329 set! (new_mts, e, message (bpc_t, e))
333330 end
@@ -338,15 +335,15 @@ end
338335"""
339336More generic interface for update, with default params
340337"""
341- function update (alg:: Algorithm , bpc:: AbstractBeliefPropagationCache ; kwargs ... )
338+ function update (alg:: Algorithm , bpc:: AbstractBeliefPropagationCache )
342339 compute_error = ! isnothing (alg. kwargs. tol)
343340 if isnothing (alg. kwargs. maxiter)
344341 error (" You need to specify a number of iterations for BP!" )
345342 end
346343 for i in 1 : alg. kwargs. maxiter
347344 diff = compute_error ? Ref (0.0 ) : nothing
348345 bpc = update_one_iteration (
349- alg, bpc, alg. kwargs. edge_sequence; (update_diff!)= diff, kwargs ...
346+ alg, bpc, alg. kwargs. edge_sequence; (update_diff!)= diff
350347 )
351348 if compute_error && (diff. x / length (alg. kwargs. edge_sequence)) <= alg. kwargs. tol
352349 if alg. kwargs. verbose
0 commit comments