所以我正在研究一个侧面项目,目的是试验遗传算法。 该项目涉及两个类,Critters和Food。 生物每次蜱虫都会感到饥饿,并在找到食物时会失去饥饿感。 小动物可以移动,食物是静止的。 每个Critter都有一个基因组,它只是一串随机生成的字符。 目标是经过几代人之后,小动物将发展出能够实现最佳食物消耗的专业运动模式。
现在,每个小动物都受神经网络的支配。 神经网络用来自Critter基因组的权重和偏差初始化。 神经网络的第一个输入是[0,0]。 神经网络产生两个输出,分别决定了Critter的x和y运动的方向。 此输出用作下一个滴答处的神经网络的输入。 例如:
1: [0,0]->NN->[.598.., -.234...] // Critter moves right and up 2: [.598...,-.234...]->NN->[-.409...,-.232...] // Critter moves left and up 3: [-.409...,-.232...]->NN-> etc.问题在于,无论权重如何初始化,神经网络都在寻找一种“固定点”。 也就是说,在两次或三次迭代之后,输出和输入实际上是相同的,因此Critter总是朝着相同的方向移动。 现在我没有训练神经网络,我真的不想。 所以我正在寻找的是另一种生成输出的方法。
更具体地说,假设我有基因组生成的n个随机权重。 我需要一个由n个权重确定的关系,这些权重可以(在最松散的意义上)将[-1,1]范围内的2个输入映射到相同范围内的两个输出。 主要的是我希望权重对函数的行为产生重大影响。 我不希望它像y = mx + b,我们只改变y和b。
我知道这是一个非常含糊的描述。 起初我认为神经网络是完美的,但似乎输入对没有训练的输出几乎没有影响(这是公平的,因为神经网络意味着训练)。
任何建议?
So I'm working on a little side-project for the purpose of experimenting with genetic algorithms. The project involves two classes, Critters and Food. The critters gain hunger each tick and lose hunger when they find food. The Critters can move, and the Food is stationary. Each Critter has a genome which is just a string of randomly generated characters. The goal is that after several generations, the Critters will evolve specialized movement patterns that result in optimal food consumption.
Right now, each Critter is governed by a neural network. The neural network is initialized with weights and biases derived from the Critter's genome. The first input into the neural network is [0,0]. The neural network produces two outputs which dictate the direction of the Critter's x and y movement respectively. This output is used as the input for the neural network at the next tick. For example:
1: [0,0]->NN->[.598.., -.234...] // Critter moves right and up 2: [.598...,-.234...]->NN->[-.409...,-.232...] // Critter moves left and up 3: [-.409...,-.232...]->NN-> etc.The problem is that, regardless of how the weights are initialized, the neural network is finding a sort of "fixed point." That is, after two or three iterations the output and input are practically the same so the Critter always moves in the same direction. Now I'm not training the neural net and I don't really want to. So what I'm looking for is an alternative method of generating the output.
More specifically, let's say I have n random weights generated by the genome. I need a relation determined by those n weights that can map (in the loosest sense of the word) 2 inputs in the range [-1,1] to two outputs in the same range. The main thing is that I want the weights to have a significant impact on the behavior of the function. I don't want it to be something like y=mx+b where we're only changing y and b.
I know that's a pretty vague description. At first I thought the Neural Network would be perfect, but it seems as though the inputs have virtually no affect on the outputs without training (which is fair since Neural Networks are meant to be trained).
Any advice?
类神经网络数据结构(Neural Network-like Data Structure)所以我正在研究一个侧面项目,目的是试验遗传算法。 该项目涉及两个类,Critters和Food。 生物每次蜱虫都会感到饥饿,并在找到食物时会失去饥饿感。 小动物可以移动,食物是静止的。 每个Critter都有一个基因组,它只是一串随机生成的字符。 目标是经过几代人之后,小动物将发展出能够实现最佳食物消耗的专业运动模式。
现在,每个小动物都受神经网络的支配。 神经网络用来自Critter基因组的权重和偏差初始化。 神经网络的第一个输入是[0,0]。 神经网络产生两个输出,分别决定了Critter的x和y运动的方向。 此输出用作下一个滴答处的神经网络的输入。 例如:
1: [0,0]->NN->[.598.., -.234...] // Critter moves right and up 2: [.598...,-.234...]->NN->[-.409...,-.232...] // Critter moves left and up 3: [-.409...,-.232...]->NN-> etc.问题在于,无论权重如何初始化,神经网络都在寻找一种“固定点”。 也就是说,在两次或三次迭代之后,输出和输入实际上是相同的,因此Critter总是朝着相同的方向移动。 现在我没有训练神经网络,我真的不想。 所以我正在寻找的是另一种生成输出的方法。
更具体地说,假设我有基因组生成的n个随机权重。 我需要一个由n个权重确定的关系,这些权重可以(在最松散的意义上)将[-1,1]范围内的2个输入映射到相同范围内的两个输出。 主要的是我希望权重对函数的行为产生重大影响。 我不希望它像y = mx + b,我们只改变y和b。
我知道这是一个非常含糊的描述。 起初我认为神经网络是完美的,但似乎输入对没有训练的输出几乎没有影响(这是公平的,因为神经网络意味着训练)。
任何建议?
So I'm working on a little side-project for the purpose of experimenting with genetic algorithms. The project involves two classes, Critters and Food. The critters gain hunger each tick and lose hunger when they find food. The Critters can move, and the Food is stationary. Each Critter has a genome which is just a string of randomly generated characters. The goal is that after several generations, the Critters will evolve specialized movement patterns that result in optimal food consumption.
Right now, each Critter is governed by a neural network. The neural network is initialized with weights and biases derived from the Critter's genome. The first input into the neural network is [0,0]. The neural network produces two outputs which dictate the direction of the Critter's x and y movement respectively. This output is used as the input for the neural network at the next tick. For example:
1: [0,0]->NN->[.598.., -.234...] // Critter moves right and up 2: [.598...,-.234...]->NN->[-.409...,-.232...] // Critter moves left and up 3: [-.409...,-.232...]->NN-> etc.The problem is that, regardless of how the weights are initialized, the neural network is finding a sort of "fixed point." That is, after two or three iterations the output and input are practically the same so the Critter always moves in the same direction. Now I'm not training the neural net and I don't really want to. So what I'm looking for is an alternative method of generating the output.
More specifically, let's say I have n random weights generated by the genome. I need a relation determined by those n weights that can map (in the loosest sense of the word) 2 inputs in the range [-1,1] to two outputs in the same range. The main thing is that I want the weights to have a significant impact on the behavior of the function. I don't want it to be something like y=mx+b where we're only changing y and b.
I know that's a pretty vague description. At first I thought the Neural Network would be perfect, but it seems as though the inputs have virtually no affect on the outputs without training (which is fair since Neural Networks are meant to be trained).
Any advice?
发布评论