Skip to content

A layer structure for any ICN

The layer.jl file defines a Layer structure and several associated functions for manipulating and interacting with this structure in the context of an Interpretable Compositional Network (ICN).

The Layer structure is used to store a LittleDict of operations that can be selected during the learning phase of an ICN. Each layer can be exclusive, meaning only one operation can be selected at a time. This is particularly useful in the context of ICNs, which are used to learn alternative expressions for highly combinatorial functions, such as those found in Constraint-based Local Search solvers.

CompositionalNetworks.Layer Type
julia
Layer

A structure to store a LittleDict of operations that can be selected during the learning phase of an ICN. If the layer is exclusive, only one operation can be selected at a time.

source

CompositionalNetworks.functions Function
julia
functions(layer)

Access the operations of a layer. The container is ordered.

source

Base.length Method
julia
length(layer)

Return the number of operations in a layer.

source

CompositionalNetworks.exclu Function
julia
exclu(layer)

Return true if the layer has mutually exclusive operations.

source

CompositionalNetworks.symbol Function
julia
symbol(layer, i)

Return the i-th symbols of the operations in a given layer.

source

CompositionalNetworks.nbits_exclu Function
julia
nbits_exclu(layer)

Convert the length of an exclusive layer into a number of bits.

source

CompositionalNetworks.show_layer Function
julia
show_layer(layer)

Return a string that contains the elements in a layer.

source

CompositionalNetworks.selected_size Function
julia
selected_size(layer, layer_weights)

Return the number of operations selected by layer_weights in layer.

source

CompositionalNetworks.is_viable Function
julia
is_viable(layer, w)
is_viable(icn)
is_viable(icn, w)

Assert if a pair of layer/icn and weights compose a viable pattern. If no weights are given with an icn, it will check the current internal value.

source

CompositionalNetworks.generate_inclusive_operations Function
julia
generate_inclusive_operations(predicate, bits)
generate_exclusive_operation(max_op_number)

Generates the operations (weights) of a layer with inclusive/exclusive operations.

source

CompositionalNetworks.generate_exclusive_operation Function
julia
generate_exclusive_operation(max_op_number)

Generates the operations (weights) of a layer with exclusive operations.

source

CompositionalNetworks.generate_weights Function
julia
generate_weights(layers)
generate_weights(icn)

Generate the weights of a collection of layers or of an ICN.

source