Files
NeuralNetworkLib/include/NeuralNetwork/Network.h

55 lines
1.0 KiB
C++

#pragma once
#include <cstddef>
#include <vector>
#include "Neuron.h"
#include "Stringifiable.h"
#include <ostream>
#include <sstream>
namespace NeuralNetwork
{
/**
* @author Tomas Cernik (Tom.Cernik@gmail.com)
* @brief Abstract model of simple Network
*/
class Network : public Stringifiable
{
public:
/**
* @brief Constructor for Network
*/
inline Network() {};
/**
* @brief Virtual destructor for Network
*/
virtual ~Network() {};
/**
* @brief This is a virtual function for all networks
* @param input is input of network
* @returns output of network
*/
virtual std::vector<float> computeOutput(const std::vector<float>& input)=0;
/**
* @param t is number of threads, if set to 0 or 1 then threading is disabled
* @brief Enables or disables Threaded computing of ANN
*/
inline virtual void setThreads(const unsigned& t) final {threads=t;}
using Stringifiable::stringify;
protected:
/**
* @brief Number of threads used by network
*/
unsigned threads=1;
};
}