Machine learning constraints

In this section: neural_net.


predicate neural_net(array [int] of var float: inputs,
                     array [int] of int: input_ids,
                     array [int] of var float: outputs,
                     array [int] of int: output_ids,
                     array [int] of float: bias,
                     array [int] of float: edge_weight,
                     array [int] of int: edge_parent,
                     array [int] of int: first_edge,
                     NEURON_TYPE: neuron_type)

Constrain the output layer of a neural net to take the value defined by the input layer.


  • inputs: an array of float variables
  • input_ids: array[int] of node
  • outputs: an array of float variables
  • output_ids: array[int] of node
  • bias: array[node] of float
  • edge_weight: array[edge] of float (dummy one at end!)
  • edge_parent: array[edge] of neuron (start neuron for edge)
  • first_edge: array[node] of 1..m+1
  • neuron_type: { NT_RELU, NT_STEP, NT_LINEAR, NT_SOFTPLUS }