Orderbook Simulation
OrderbookSim is a C++ application simulating a financial market order book. It efficiently manages and matches buy and sell orders while calculating the Volume-Weighted Average Price (VWAP).
Net.hpp
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include "Neuron.hpp"
12 #include <iostream>
13 #include <cstdlib>
14 #include <cassert>
15 #include <cmath>
16 #include <fstream>
17 #include <sstream>
18 #include <filesystem>
19 
28 class Net {
29 public:
35  Net();
36 
45  Net(const std::vector<unsigned> topology);
46 
55  void loadTopology(const std::vector<unsigned> topology);
56 
64  void feedForward(const std::vector<double>& inputVals);
65 
74  void backProp(const std::vector<double>& targetVals);
75 
83  void getResults(std::vector<double>& resultVals) const;
84 
93  double getRecentAverageError() const { return _recentAverageError; }
94 
95 private:
96  std::vector<Layer> _layers;
97  double _error = 0;
98  double _recentAverageError = 0;
99  static double _recentAverageSmoothFactor;
100 };
Defines the Neuron class for a neural network.
Represents a neural network composed of layers of neurons.
Definition: Net.hpp:28
Net(const std::vector< unsigned > topology)
Constructs the network and sets up the topology.
double getRecentAverageError() const
Gets the recent average error of the network.
Definition: Net.hpp:93
void loadTopology(const std::vector< unsigned > topology)
Sets up the network topology.
void getResults(std::vector< double > &resultVals) const
Retrieves the output values from the final layer of the network.
Definition: Net.cpp:34
Net()
Default constructor for the Net class.
void backProp(const std::vector< double > &targetVals)
Executes backpropagation to adjust weights based on target values.
Definition: Net.cpp:49
void feedForward(const std::vector< double > &inputVals)
Performs forward propagation through the network.
Definition: Net.cpp:98