#### Archived

This topic is now archived and is closed to further replies.

# ai-junkie tutorial on neural networks

## Recommended Posts

asperitas    122
question 1 On page six of the neural network tutorial, there is an equation that sums up all of the weights multiplied by their corresponding inputs. eg. i1*w1 + i2*w2 + ... + in*wn - t >= 0 where t is some threshold how do you know that this will always be greater than or equal than zero? question 2 In the CGenAlg::Epoch method of the minesweeper code. why will the roulette wheel crash if the value of iNumElite is not even? I think that these are questions that will be that obvious when i hear the answer that i will shoot myself. sorry for not asking at the ai-junkie forum but for some reason i cant create a user there. thx for any help

##### Share on other sites
fup    463
Hi there,

Tis weird indeed that you cannot create a user. Maybe EZBoard is having a bad day! Anyway, here are the answers to your questions.

"i1*w1 + i2*w2 + ... + in*wn - t >= 0
where t is some threshold

how do you know that this will always be greater than or equal than zero?"

What this equation is saying, is that if the LHS is greater than zero then the neuron fires, if the LHS is less the neuron doesn''t fire. Get it now?

"In the CGenAlg::Epoch method of the minesweeper code. why will the roulette wheel crash if the value of iNumElite is not even?"

Because the crossover function creates offspring in pairs. If iNumElite is odd then there will be an odd amount of offspring to create and the epoch function will crash. It''s just the way I coded it. You can easily fix it by coding a crossover function that just creates one offspring instead of two.

I hope that last piece of advice is correct because I''m in a rush and relying entirely on my memory... which ain''t too good nowadays. ;0)

ai-junkie.com

##### Share on other sites
Timkin    864
quote:
Original post by fup
You can easily fix it by coding a crossover function that just creates one offspring instead of two.

That would be akin to letting the runt of the litter die at birth!

Timkin

##### Share on other sites
asperitas    122
i figured out the roulette wheel question after i posted but thanks for explaining the threshold thing

##### Share on other sites
asperitas    122
i figured out the roulette wheel question after i posted but thanks for explaining the threshold thing