Skip to content

Commit

Permalink
Add a max_icn_length function
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzaare committed Jul 15, 2021
1 parent 26d144d commit dce3191
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/CompositionalNetworks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export hamming
export lazy
export lazy_param
export manhattan
export max_icn_length
export minkowski
export regularization

Expand Down
2 changes: 2 additions & 0 deletions src/icn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,5 @@ function regularization(icn)
end
return Σop / (Σmax + 1)
end

max_icn_length(icn = ICN(param = true)) = length(icn.transformation)
1 change: 1 addition & 0 deletions test/icn.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# # Test with manually weighted ICN
icn = ICN(param=true)
@test max_icn_length() == 18
show_layers(icn)
icn.weigths = vcat(trues(18), falses(6))
@test CN.is_viable(icn)
Expand Down

0 comments on commit dce3191

Please sign in to comment.