1
$\begingroup$

I'm trying to understand how to build the ANN on cognitrons, so I have read theory for that topic and found the scheme:
Cognitrons
As I got neurons are subdivided in two classes: the exciting and the inhibitory. I have written these classes:
Exciting neuron:

typedef float signal;
typedef std::vector<signal> sigvec;

class inhibitory_neuron
{
public:
    inhibitory_neuron() {}
    ~inhibitory_neuron() {}
    virtual signal call(const sigvec &e_inputs, const sigvec &i_inputs)
    {
        unused(i_inputs);
        signal sum = 0;

        for (auto i = std::begin(e_inputs); i != std::end(e_inputs); ++i) {
            sum += *i;
        }

        return sum;
    }
};

Here e_inputs are c-factors (sum of c is 1). But in the formula:
Formula
I can't get it... Whaz OUT_i there? And below my Exciting neuron class is:

class exciting_neuron : inhibitory_neuron
{
protected:
    std::unique_ptr<sigvec> m_e_weights;
    std::unique_ptr<sigvec> m_i_weights;
public:
    exciting_neuron(sigvec &&e_weights, sigvec &&i_weights)
        : m_e_weights{std::make_unique<sigvec>(std::move(e_weights))},
          m_i_weights{std::make_unique<sigvec>(std::move(i_weights))}
    {

    }
    ~exciting_neuron() {}
    signal call(const sigvec& e_inputs, const sigvec& i_inputs) override
    {
        auto ew = *m_e_weights;
        auto iw = *m_i_weights;
        auto ei = e_inputs;
        auto ii = i_inputs;

        if (ew.size() != iw.size() || iw.size() != ii.size())
        {
            throw std::invalid_argument("Wrong input size.");
        }

        signal e_sum = 0, i_sum = 0;

        for (unsigned int j = 0; j < ew.size(); ++j)
        {
            e_sum += ew[j] * ei[j];
        }

        for (unsigned int j = 0; j < iw.size(); ++j)
        {
            i_sum += iw[j] * ii[j];
        }

        signal n = (1 + e_sum) / (1 + i_sum) - 1;
        return n >= 0 ? n : 0;
    }
};

Here e_inputs are a-factors (exciting) and i_inputs are b-factors (inhibitory).
But how should the ANN structure look? I mean I can't get where should I put an exciting neuron and an inhibitory... Has it some samples or rules of the structure, I couldn't find?

$\endgroup$
  • 1
    $\begingroup$ Welcome to AI! Props for our first question on neocognitrons! $\endgroup$ – DukeZhou Dec 8 '17 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.