Newer
Older

Michal Kravcenko
committed
/**
* DESCRIPTION OF THE FILE
*
* @author Michal Kravčenko
* @date 13.6.18 -
*/

Michal Kravcenko
committed
//TODO pouvazovat o pridani indexu k neuronum, abychom meli urcitou kontrolu nad poradim vstupu a vystupu?

Michal Kravcenko
committed
#ifndef INC_4NEURO_NEURALNETWORK_H
#define INC_4NEURO_NEURALNETWORK_H

Michal Kravcenko
committed
#include <vector>
#include "../Neuron/Neuron.h"

Michal Kravcenko
committed
enum NET_TYPE{GENERAL};

Michal Kravcenko
committed

Michal Kravcenko
committed
/**
*
*/
class NeuralNetwork {
private:
/**
*
*/
NET_TYPE network_type = GENERAL;

Michal Kravcenko
committed
/**
*
*/
std::vector<Neuron*> *neurons = nullptr;
/**
*
*/
std::vector<Neuron*>* input_neurons = nullptr;
/**
*
*/
std::vector<Neuron*>* output_neurons = nullptr;
std::vector<double>* connection_weights = nullptr;

Michal Kravcenko
committed
/**
*
*/
int n_inputs = -1;
/**
*
*/
int n_outputs = -1;
/**
*
*/
bool in_out_determined = false;

Michal Kravcenko
committed
std::vector<Neuron*>* active_eval_set = nullptr;
/**
*
*/
void determine_inputs_outputs();

Michal Kravcenko
committed
public:
/**
*
*/

Michal Kravcenko
committed
NeuralNetwork();
/**
*
*/
~NeuralNetwork();
/**
*
* @param[in] input
* @param[in,out] output
*/
void eval_single(std::vector<double> &input, std::vector<double> &output);
/**
*
* @param[in] n
* @return
*/
int add_neuron(Neuron* n);
/**
*
* @param n1_idx
* @param n2_idx
*/
void add_connection_simple(int n1_idx, int n2_idx);
/**
*
* @param n1_idx
* @param n2_idx
* @param weight_idx
*/
void add_connection_simple(int n1_idx, int n2_idx, int weight_idx);
/**
*
* @param[in] n1_idx
* @param[in] n2_idx
* @param[in] weight_idx
* @param[in] weight_value
*/
void add_connection_simple(int n1_idx, int n2_idx, int weight_idx, double weight_value);
/**
*
* @param n1_idx
* @param n2_idx
* @param f
* @param weight_indices
* @param weight_values
* @param n_weights

Michal Kravcenko
committed
*/
void add_connection_general(int n1_idx, int n2_idx, std::function<double(double *, int*, int)> *f, int* weight_indices, double* weight_values, int n_weights);

Michal Kravcenko
committed

Michal Kravcenko
committed
/**
*
* @param weights
*/
void copy_weights(double *weights);

Michal Kravcenko
committed

Michal Kravcenko
committed
};
#endif //INC_4NEURO_NEURALNETWORK_H