Neat little story, despite the grammar and capitalization. Is it common to use _ as an index variable? Edit: for _ in range(4):
I've seen it before, but it's a little jarring. Not sure what's wrong with just using i.
A Story to Explain Genetic Algorithms
11–20 of 35 posts
Re: A Story to Explain Genetic Algorithms
#12> Then our Charles simply had to figure out how Mrs Kipling scored the cakes and he could genetically evolve the best cake! "And then a miracle happens." Isn't the fitness function the "key ingredient?" (It's in the source code, but not in the text for a reason.) Still a good explanation of the rest.
Re: A Story to Explain Genetic Algorithms
#13Neat little story, despite the grammar and capitalization. Is it common to use _ as an index variable? Edit: for _ in range(4):
Re: A Story to Explain Genetic Algorithms
#14Neat little story, despite the grammar and capitalization. Is it common to use _ as an index variable? Edit: for _ in range(4):
Re: A Story to Explain Genetic Algorithms
#15Lol... long and hard.
Re: A Story to Explain Genetic Algorithms
#16Re: A Story to Explain Genetic Algorithms
#17Re: A Story to Explain Genetic Algorithms
#18> Then our Charles simply had to figure out how Mrs Kipling scored the cakes and he could genetically evolve the best cake! "And then a miracle happens." Isn't the fitness function the "key ingredient?" (It's in the source code, but not in the text for a reason.) Still a good explanation of the rest.
One of the favorite quotes of my graduate advisor, thanks for the chuckle :)
For those who are unfamiliar with the reference:
http://star.psy.ohio-state.edu/coglab/Miracle.html (mirror image: http://i.imgur.com/k7gm70t.jpg)
Re: A Story to Explain Genetic Algorithms
#19Earlier quoted context omitted.
I've seen it before, but it's a little jarring. Not sure what's wrong with just using i.
It says explicitly that you don't care about that value. If you used i, for example, you wouldn't know whether the loop depended on the iteration number.
Re: A Story to Explain Genetic Algorithms
#20Neat little story, despite the grammar and capitalization. Is it common to use _ as an index variable? Edit: for _ in range(4):
It's better to use two underscores __ to represent throwaway variables, because _ has a meaning in Python: it returns the last output.
For example try to run the following script (not from the REPL):
_ = 12
print _
42 * 42
print _