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).
Public Member Functions | List of all members
TrainingData Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TrainingData()

TrainingData::TrainingData ( const std::string  filename)

Constructs a TrainingData object and opens the specified training data file.

Parameters
filenameThe path to the training data file.

Member Function Documentation

◆ getNextInputs()

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.

Parameters
[out]inputValsA vector to store the input values.
Returns
The number of input values read.

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.

Parameters
[out]inputValsA vector to store the input values.
Returns
The number of input values read.

◆ getTargetOutputs()

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.

Parameters
[out]targetOutputsValsA vector to store the target output values.
Returns
The number of target output values read.

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.

Parameters
[out]targetOutputsValsA vector to store the target output values.
Returns
The number of target output values read.

◆ getTopology()

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.

Parameters
[out]topologyA 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.

Parameters
[out]topologyA vector to store the number of neurons in each layer of the network.

◆ isEof()

bool TrainingData::isEof ( void  )
inline

Checks if the end of the training data file has been reached.

Returns
True if end of file is reached, otherwise false.

The documentation for this class was generated from the following files: