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
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.
CompositionalNetworks.functions Function
functions(layer)
Access the operations of a layer. The container is ordered.
CompositionalNetworks.exclu Function
exclu(layer)
Return true
if the layer has mutually exclusive operations.
CompositionalNetworks.symbol Function
symbol(layer, i)
Return the i-th symbols of the operations in a given layer.
CompositionalNetworks.nbits_exclu Function
nbits_exclu(layer)
Convert the length of an exclusive layer into a number of bits.
CompositionalNetworks.show_layer Function
show_layer(layer)
Return a string that contains the elements in a layer.
CompositionalNetworks.selected_size Function
selected_size(layer, layer_weights)
Return the number of operations selected by layer_weights
in layer
.
CompositionalNetworks.is_viable Function
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.
CompositionalNetworks.generate_inclusive_operations Function
generate_inclusive_operations(predicate, bits)
generate_exclusive_operation(max_op_number)
Generates the operations (weights) of a layer with inclusive/exclusive operations.
CompositionalNetworks.generate_exclusive_operation Function
generate_exclusive_operation(max_op_number)
Generates the operations (weights) of a layer with exclusive operations.
CompositionalNetworks.generate_weights Function
generate_weights(layers)
generate_weights(icn)
Generate the weights of a collection of layers or of an ICN.