Artificial intelligence (Light follower)

Is this for sunlight? If it keeps moving around perhaps it is not registering the intensity of the light source. I briefly looked at the code and I am not sure if the area where you have inputs and weights is intended for this. I remember from doing a light sensor tutorial that the resistance from the sensor varies with light intensity. Maybe setting limits on the intensity will allow your sketch to hold a focus point for a given intensity?