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).
|
Manages reading and parsing of training data for neural network training. More...
#include <TrainingData.hpp>
Public Member Functions | |
TrainingData (const std::string filename) | |
Constructs a TrainingData object and opens the specified training data file. More... | |
bool | isEof (void) |
Checks if the end of the training data file has been reached. More... | |
void | getTopology (std::vector< unsigned > &topology) |
Reads the network topology from the training data file. More... | |
unsigned | getNextInputs (std::vector< double > &inputVals) |
Reads the next set of input values from the training data file. More... | |
unsigned | getTargetOutputs (std::vector< double > &targetOutputsVals) |
Reads the next set of target output values from the training data file. More... | |
Manages reading and parsing of training data for neural network training.
This class provides methods to read topology information, input values, and target output values from a structured file. It assumes the file follows a specific format.
TrainingData::TrainingData | ( | const std::string | filename | ) |
Constructs a TrainingData object and opens the specified training data file.
filename | The path to the training data file. |
unsigned TrainingData::getNextInputs | ( | std::vector< double > & | inputVals | ) |
Reads the next set of input values from the training data file.
The input line in the file should start with "in:" followed by a sequence of input values.
[out] | inputVals | A vector to store the input values. |
This method reads a line from the training file that starts with "in:" followed by input values, and populates the provided vector with those values.
[out] | inputVals | A vector to store the input values. |
unsigned TrainingData::getTargetOutputs | ( | std::vector< double > & | targetOutputsVals | ) |
Reads the next set of target output values from the training data file.
The target output line in the file should start with "out:" followed by a sequence of target values.
[out] | targetOutputsVals | A vector to store the target output values. |
This method reads a line from the training file that starts with "out:" followed by target output values, and populates the provided vector with those values.
[out] | targetOutputsVals | A vector to store the target output values. |
void TrainingData::getTopology | ( | std::vector< unsigned > & | topology | ) |
Reads the network topology from the training data file.
Reads the topology of the neural network from the training data file.
The topology is represented by a line starting with "topology:" followed by integers indicating the number of neurons in each layer.
[out] | topology | A vector to store the number of neurons in each layer. |
The topology line in the training data file should start with "topology:" followed by the number of neurons in each layer. This method reads the topology information and populates the provided vector.
[out] | topology | A vector to store the number of neurons in each layer of the network. |
|
inline |
Checks if the end of the training data file has been reached.