moved Linear sintrigification to .cpp file and fixed err in neuron weights
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user