Skip to content
Snippets Groups Projects
NeuronBinary.cpp 469 B
Newer Older
  • Learn to ignore specific revisions
  • //
    // Created by fluffymoo on 11.6.18.
    //
    
    #include "NeuronBinary.h"
    
    NeuronBinary::NeuronBinary(double threshold) {
        this->activation_function_parameters = new double[1];
        this->activation_function_parameters[0] = threshold;
    }
    
    
    void NeuronBinary::activate( ) {
    
        double x = this->potential;
        double threshold = this->activation_function_parameters[0];
    
        if(x >= threshold){
    
            this->state = 1.0;
        }
        else{
            this->state = 0.0;
        }
    }