summaryrefslogtreecommitdiffstats
path: root/ai/Layer.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-06-04 01:35:20 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-06-04 01:35:20 +0000
commit3595239f08f2bc1df32ef22ed6de9bde10ca3384 (patch)
treed9962c84e3a1f19e2da422f9bb49f65c21ada9f6 /ai/Layer.cpp
parentc9afda3ab74614fb36986f96b7972c082f275eca (diff)
downloadsigen-3595239f08f2bc1df32ef22ed6de9bde10ca3384.tar.gz
sigen-3595239f08f2bc1df32ef22ed6de9bde10ca3384.tar.xz
sigen-3595239f08f2bc1df32ef22ed6de9bde10ca3384.zip
Style cleanup, minor Matrix fixes, duplication validations, Pokemod methods
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@19 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'ai/Layer.cpp')
-rw-r--r--ai/Layer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ai/Layer.cpp b/ai/Layer.cpp
index 97ba87b6..5ba794a1 100644
--- a/ai/Layer.cpp
+++ b/ai/Layer.cpp
@@ -51,7 +51,7 @@ void PokeGen::NeuralNetwork::Layer::DeleteNode(int n)
void PokeGen::NeuralNetwork::Layer::UpdateBias(int n)
{
if (n < 0)
- bias.push_back((abs(std::rand())%201)/100.0);
+ bias.push_back((abs(std::rand()) % 201) / 100.0);
else if (n < GetNumNodes())
bias.erase(bias.begin() + n);
else
@@ -69,7 +69,7 @@ void PokeGen::NeuralNetwork::Layer::RandomizeWeights()
{
bias.clear();
for (int i = 0; i < child->GetNumNodes(); ++i)
- bias.push_back((abs(std::rand())%201)/100.0);
+ bias.push_back((abs(std::rand()) % 201) / 100.0);
for (int i = 0; i < GetNumNodes(); ++i)
nodes[i].RandomizeWeights();
}