From 27794955053bb14c723f210948665cf76a52c2cd Mon Sep 17 00:00:00 2001 From: Jean-Francois Baffier Date: Mon, 12 Aug 2024 19:35:43 +0900 Subject: [PATCH] Fixes for learning ICN with CBLS (#19) * Compat, CI, and Parallelism: release (#18) * Cleaning and CI updates (#13) * Cleaning and CI updates * Fix CI for Julia 1.8 * Compat ci (#17) * Cleaning and CI updates (#13) (#14) * Cleaning and CI updates * Fix CI for Julia 1.8 * Compat and CI * Fixes for learning ICN aith CBLS --- src/icn/cbls.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/icn/cbls.jl b/src/icn/cbls.jl index abb07e5..1fe08ec 100644 --- a/src/icn/cbls.jl +++ b/src/icn/cbls.jl @@ -91,8 +91,13 @@ function CompositionalNetworks.optimize!( @debug "pool" s.pool best_values(s.pool) best_values(s) s.pool.configurations # Return best values - best = BitVector(collect(best_values(s))) - weights!(icn, best) + + if has_solution(s) + weights!(icn, BitVector(collect(best_values(s)))) + else + CompositionalNetworks.generate_weights(icn) + end + best = weights(icn) return best, Dictionary{BitVector, Int}([best], [1]) end