<commit_before>#include "soma.h"
#include "synapse.h"

Soma::Soma(float init_threshold)
{
    threshold = init_threshold;
}

float Soma::add_incoming_values()
{
    int number_synapses = all_synapses.size();
    float incoming_values = 0;

    for(int i=0; i<number_synapses; i++)
    {
        incoming_values += all_synapses.at(i).get_weighted_incoming_value();
    }

    return incoming_values;
}

/* For now, this is merely a stepper function, binary. Might extend this to allow for gradient. */
float Soma::activate(float incoming_values)
{
    float activation_result;

    if (incoming_values < threshold)
    {
        activation_result = 0.0;
    } else
    {
        activation_result = 1.0;
    }

    return activation_result;
}
<commit_msg>Update soma.cpp<commit_after>#include "soma.h"
#include "synapse.h"

Soma::Soma(float init_threshold)
{
    threshold = init_threshold;
}

float Soma::add_incoming_values()
{
    float incoming_values = 0;

    for(auto& synapse: all_synapses)
    {
        incoming_values += synapse.get_weighted_incoming_value();
    }

    return incoming_values;
}

/* For now, this is merely a stepper function, binary. Might extend this to allow for gradient. */
float Soma::activate(float incoming_values)
{
    float activation_result;

    if (incoming_values < threshold)
    {
        activation_result = 0.0;
    } else
    {
        activation_result = 1.0;
    }

    return activation_result;
}

{'fraction_non_alphanumeric': 0.1042817679558011, 'fraction_numerical': 0.007596685082872928, 'mean_word_length': 3.261764705882353, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2087629', 'n_tokens_mistral': 493, 'n_tokens_neox': 473, 'n_words': 107}