Genetic method to solve a problem:

//pseudo-code
while (true) {
  Find better inner-changes for data entries (gene editing)
  (or)
  Find better changes thru' transplant between data entries 
  (gene mixing, 2 children)
  (or)
  Find better changes thru' exchanging substructures
  between data entries (gene mixing, 2 children)
  (or)
  Find better changes thru' mixing data entries to 
  make new generations. (gene mixing, 1+ children)

  if No_Improvement_Found:
    break;
}

Perceptron/Neural Network method to solve a problem:

//pseudo-code (perceptron or single neuron)
while (true) {

  Error_Count = 0;
  for (all sample entries) {
    apply_weights_to_each_sample_entry();
    get_weighted_sum();
    get_output_thru_activation_function();
    get_error_value();
    update_weights();

    if (output is not the same as output in sample entry)
      Error_Count++;
  }

  //no more error found which means
  //weights make correct outputs for all samples
  if (Error_Count==0)
    break;
}

//pseudo-code (neural network)
while (true) {

  Error_Count = 0;
  for (all sample entries) {
    Output = propagate_forwards(Sample_Entry);
    get_error_value();
    propagate_backwards_and_update_weights(Output);

    if (output is not the same as output in sample entry)
      Error_Count++;
  }

  //no more error found
  if (Error_Count==0)
    break;
}
Advertisements