reffactored and recurrent implementation
This commit is contained in:
55
include/NeuralNetwork/Network.h
Normal file
55
include/NeuralNetwork/Network.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user