Skip to content
Snippets Groups Projects
Commit 72e8af43 authored by Martin Beseda's avatar Martin Beseda
Browse files

[FIX] [WIP] Added exception. Implementing ACSF neural network.

parent 569d5c90
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ lib4neuro::ACSFNeuralNetwork::ACSFNeuralNetwork(std::unordered_map<ELEMENT_SYMBO
std::vector<size_t> subnet_outputs;
size_t neuron_idx;
std::unordered_map<ELEMENT_SYMBOL, std::vector<size_t>> subnet_idxs;
std::unordered_map<ELEMENT_SYMBOL, std::vector<size_t>> subnet_neuron_idxs;
std::unordered_map<ELEMENT_SYMBOL, std::vector<size_t>> subnet_connection_idxs;
......@@ -82,8 +83,9 @@ lib4neuro::ACSFNeuralNetwork::ACSFNeuralNetwork(std::unordered_map<ELEMENT_SYMBO
BIAS_TYPE::NEXT_BIAS);
subnet_neuron_idxs[elements_list.at(i)].emplace_back(neuron_idx);
} else {
std::cout << subnet_neuron_idxs[elements_list.at(i)].at(0)+local_neuron_idx << std::endl;
neuron_idx = this->add_neuron(hid_n,
BIAS_TYPE::EXISTING_BIAS, subnet_neuron_idxs[elements_list.at(i)].at(0)+local_neuron_idx);
BIAS_TYPE::EXISTING_BIAS, local_neuron_idx);
}
local_neuron_idx++;
new_layer.emplace_back(neuron_idx);
......
......@@ -52,7 +52,7 @@ namespace lib4neuro {
this->neuron_biases.resize(this->neuron_biases.size() + 1);
} else if (bt == BIAS_TYPE::EXISTING_BIAS) {
if (bias_idx >= this->neuron_biases.size()) {
::std::cerr << "The supplied bias index is too large!\n" << ::std::endl;
THROW_RUNTIME_ERROR("The supplied bias index is too large!");
}
this->neuron_bias_indices.push_back((int) bias_idx);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment