init commit
This commit is contained in:
43
backprop/neurone.cpp
Normal file
43
backprop/neurone.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include "neurone.h"
|
||||
|
||||
Neurone::Neurone(){
|
||||
nextNeurone=NULL;
|
||||
weight=0.0;
|
||||
}
|
||||
|
||||
Neurone::Neurone(const double w,const Neurone* next){
|
||||
nextNeurone=(Neurone*)next;
|
||||
weight=(double)w;
|
||||
}
|
||||
|
||||
bool Neurone::getState() const{
|
||||
return bool(weight > ACTIVE);
|
||||
}
|
||||
|
||||
double Neurone::getWeight() const{
|
||||
return weight;
|
||||
}
|
||||
|
||||
void Neurone::setWeight(const double a){
|
||||
weight=a;
|
||||
}
|
||||
|
||||
void Neurone::setNextNeurone(const Neurone* next){
|
||||
nextNeurone=(Neurone*)next;
|
||||
}
|
||||
|
||||
Neurone* Neurone::getNextNeurone() const{
|
||||
return nextNeurone;
|
||||
}
|
||||
|
||||
void Neurone::operator =(double w){
|
||||
weight = w;
|
||||
}
|
||||
|
||||
Neurone& Neurone::operator =(const Neurone& n){
|
||||
if(this!=&n){
|
||||
weight = n.getWeight();
|
||||
nextNeurone = n.getNextNeurone();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
Reference in New Issue
Block a user