Skip to content

Commit d7b1564

Browse files
authored
Merge pull request #75 from JuliaConstraints/fixes
Fixes for learning ICNs with CBLS
2 parents 29665c1 + a2c4760 commit d7b1564

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/icn.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ function _compose(icn::ICN)
133133

134134
if exclu(layer)
135135
f_id = as_int(@view weights(icn)[_start:_end])
136+
# @warn "debug" f_id _end _start weights(icn) (exclu(layer) ? "nbits_exclu(layer)" : "length(layer)") (@view weights(icn)[_start:_end])
136137
s = symbol(layer, f_id + 1)
137138
push!(funcs, [functions(layer)[s]])
138139
push!(symbols, [s])

src/layer.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ exclu(layer) = layer.exclusive
3030
symbol(layer, i)
3131
Return the i-th symbols of the operations in a given layer.
3232
"""
33-
symbol(layer, i) = collect(keys(functions(layer)))[i]
33+
symbol(layer, i) = begin
34+
if i > length(layer)
35+
@info layer i functions(layer)
36+
end
37+
collect(keys(functions(layer)))[i]
38+
end
3439

3540
"""
3641
nbits_exclu(layer)

0 commit comments

Comments
 (0)