Skip to content

Commit

Permalink
Merge pull request #75 from JuliaConstraints/fixes
Browse files Browse the repository at this point in the history
Fixes for learning ICNs with CBLS
  • Loading branch information
Azzaare authored Aug 12, 2024
2 parents 29665c1 + a2c4760 commit d7b1564
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/icn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ function _compose(icn::ICN)

if exclu(layer)
f_id = as_int(@view weights(icn)[_start:_end])
# @warn "debug" f_id _end _start weights(icn) (exclu(layer) ? "nbits_exclu(layer)" : "length(layer)") (@view weights(icn)[_start:_end])
s = symbol(layer, f_id + 1)
push!(funcs, [functions(layer)[s]])
push!(symbols, [s])
Expand Down
7 changes: 6 additions & 1 deletion src/layer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ exclu(layer) = layer.exclusive
symbol(layer, i)
Return the i-th symbols of the operations in a given layer.
"""
symbol(layer, i) = collect(keys(functions(layer)))[i]
symbol(layer, i) = begin
if i > length(layer)
@info layer i functions(layer)
end
collect(keys(functions(layer)))[i]
end

"""
nbits_exclu(layer)
Expand Down

0 comments on commit d7b1564

Please sign in to comment.