Public

CompositionalNetworks.codeFunction
code(c::Composition, lang=:maths; name="composition")

Access the code of a composition c in a given language lang. The name of the generated method is optional.

source
CompositionalNetworks.comparison_layerFunction
comparison_layer(param = false)

Generate the layer of transformations functions of the ICN. Iff param value is set, also includes all the parametric comparison with that value. The operations are mutually exclusive, that is only one will be selected.

source
CompositionalNetworks.composeFunction
compose(icn, weigths=nothing)

Return a function composed by some of the operations of a given ICN. Can be applied to any vector of variables. If weigths are given, will assign to icn.

source
CompositionalNetworks.compose_to_file!Method
compose_to_file!(concept, name, path; domains, param = nothing, language = :Julia, search = :complete, global_iter = 10, local_iter = 100, metric = hamming, popSize = 200)

Explore, learn and compose a function and write it to a file.

Arguments:

  • concept: the concept to learn
  • name: the name to give to the constraint
  • path: path of the output file

Keywords arguments:

  • domains: domains that defines the search space
  • param: an optional paramater of the constraint
  • language: the language to export to, default to :julia
  • search: either :partial or :complete search
  • global_iter: number of learning iteration
  • local_iter: number of generation in the genetic algorithm
  • metric: the metric to measure the distance between a configuration and known solutions
  • popSize: size of the population in the genetic algorithm
source
CompositionalNetworks.explore_learn_composeMethod
explore_learn_compose(concept; domains, param = nothing, search = :complete, global_iter = 10, local_iter = 100, metric = hamming, popSize = 200, action = :composition)

Explore a search space, learn a composition from an ICN, and compose an error function.

Arguments:

  • concept: the concept of the targeted constraint
  • domains: domains of the variables that define the training space
  • param: an optional parameter of the constraint
  • search: either flexible,:partial or :complete search. Flexible search will use search_limit and solutions_limit to determine if the search space needs to be partially or completely explored
  • global_iter: number of learning iteration
  • local_iter: number of generation in the genetic algorithm
  • metric: the metric to measure the distance between a configuration and known solutions
  • popSize: size of the population in the genetic algorithm
  • action: either :symbols to have a description of the composition or :composition to have the composed function itself
source
CompositionalNetworks.hammingMethod
hamming(x, X)

Compute the hamming distance of x over a collection of solutions X, i.e. the minimal number of variables to switch in xto reach a solution.

source
CompositionalNetworks.lazyMethod
lazy(funcs::Function...)

Generate methods extended to a vector instead of one of its components. A function f should have the following signature: f(i::Int, x::V).

source
CompositionalNetworks.lazy_paramMethod
lazy_param(funcs::Function...)

Generate methods extended to a vector instead of one of its components. A function f should have the following signature: f(i::Int, x::V; param).

source
CompositionalNetworks.learn_composeMethod
learn_compose(;
    nvars, dom_size, param=nothing, icn=ICN(nvars, dom_size, param),
    X, X_sols, global_iter=100, local_iter=100, metric=hamming, popSize=200
)

Create an ICN, optimize it, and return its composition.

source
CompositionalNetworks.regularizationMethod
regularization(icn)

Return the regularization value of an ICN weigths, which is proportional to the normalized number of operations selected in the icn layers.

source