moved Linear sintrigification to .cpp file and fixed err in neuron weights

This commit is contained in:
2016-02-16 23:23:48 +01:00
parent 5bb132d84e
commit 69b530d597
6 changed files with 96 additions and 88 deletions

View File

@@ -104,7 +104,7 @@ namespace NeuralNetwork
Neuron(unsigned long _id=0, const ActivationFunction::ActivationFunction &activationFunction=ActivationFunction::Sigmoid(-4.9)):
NeuronInterface(), basis(new BasisFunction::Linear),
activation(activationFunction.clone()),
id_(_id),weights(_id+1),_output(0),_value(0) {
id_(_id),weights(1),_output(0),_value(0) {
}
Neuron(const Neuron &r): NeuronInterface(), basis(r.basis->clone()), activation(r.activation->clone()),id_(r.id_),
@@ -151,8 +151,8 @@ namespace NeuralNetwork
}
virtual void setInputSize(const std::size_t &size) override {
if(weights.size()<size+1) {
weights.resize(size+1);
if(weights.size()<size) {
weights.resize(size);
}
}