4

I have an ANN that controls an artificial herbivore. The inputs are the closest plant's magnitude and direction, the closest mate's magnitude and direction, and the herbivore's health. The outputs are a movement vector (direction and magnitude). Is it necessary to use a bias if it is being trained by a genetic algorithm?

Fred Foo
  • 355,277
  • 75
  • 744
  • 836
Conner Ruhl
  • 1,693
  • 4
  • 20
  • 31
  • 2
    depends on how is the genetic algorithm implemented and how complex the problem is. You should always have some bias in taking new population and determining the fitness value – Marek Sebera Jan 20 '12 at 00:30
  • 1
    Bias within the ANN, not the GA. – Conner Ruhl Jan 20 '12 at 00:35
  • ah, my fault. no, in that case, i believe it is not necessary. – Marek Sebera Jan 20 '12 at 00:38
  • i think bias is used to fit the output of a neuron into a certain range, you should decide if you need to. it shouldn't affect the performance of the genetic algorithm... – yurib Jan 20 '12 at 00:43

2 Answers2

7

The bias is used to shift the desicion boundary of the neural network away from the origin. For a simple perceptron doing simple linear classification this is equal to moving the line separating the two classes. (think of c in simple linear regression.

Genetic algorithms is just one of many ways to search for the optimal weights. It doesn't care if you have a bias or not since the bias is only another weight to it!

Therefore use a bias, it can speed up training and allows the network to learn patterns it may not be able to learn otherwise!

Edit to answer your specific question: no it isn't necessary to use a bias per se, the network can work without it, but since it's so easy to implement and improves your network- use it!

Niclas
  • 1,220
  • 6
  • 12
  • 1
    +1. Also, think of the class prior in Naive Bayes (which can be regarded as a linear model, and then the class prior is exactly the bias term in a single-layer perceptron). – Fred Foo Jan 20 '12 at 18:01
-2

You should use a bias, the bias not only allows you to solve problems that are not linearly separable; but it also allows for training of the pseudo threshold values which are interconnections between the bias neuron and the other neurons. In general, it would more likely help your attempts than hinder them.

Romaine Carter
  • 637
  • 11
  • 23
  • 1
    "The bias allows you to solve problems that are not linearly separable" -- how is that? A single-layer perceptron with a bias/intercept term is still a linear model. – Fred Foo Jan 20 '12 at 14:49
  • That's true, but the bias neuron would not hurt the solution. – Romaine Carter Jan 20 '12 at 15:11