Commit 2da77a30 authored by Michal Kravcenko's avatar Michal Kravcenko

ADD: added a functionality for shifting the outputs of a data sets

parent 125bf9c7
......@@ -102,6 +102,17 @@ namespace lib4neuro {
}
void DataSet::shift_outputs_to_zero() {
auto first_elem = this->data.at(0).second;
for(size_t j = 0; j < this->data.size(); ++j){
for(size_t i = 0; i < this->get_output_dim(); ++i){
this->data.at(j).second[i] -= first_elem[i];
}
}
}
void DataSet::add_data_pair(std::vector<double>& inputs,
std::vector<double>& outputs) {
if (this->n_elements == 0 && this->input_dim == 0 && this->output_dim == 0) {
......
......@@ -130,6 +130,11 @@ namespace lib4neuro {
unsigned int output_dim,
NormalizationStrategy* ns = nullptr);
/**
*
*/
LIB4NEURO_API void shift_outputs_to_zero();
/**
* Getter for number of elements
* @return Number of elements in the data set
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment