NNData
class NNData : public NNObject
{
public:
virtual std::string getType() = 0;
virtual std::string toString() = 0;
virtual std::shared_ptr<NNData> clone(bool deep) = 0;
};
Introduction to the class
Base class for neural network data, defining basic interfaces for neural network data objects.
This class serves as the base for neural network data objects, providing a set of pure virtual functions that define basic operations for neural network data objects, such as:
retrieving the data type.
converting to a string representation.
cloning the data object.
It inherits from the NNObject class, indicating that it is a neural network object.
Introduction to the Class's Methods
std::string getType()
brief: Get the data type. This is a pure virtual function that requires subclasses to implement it. It is used to return the type information of the current data object.
return string: A string representing the data type.
std::string toString()
brief: Convert the data object to a string representation. This is a pure virtual function that requires subclasses to implement it. It is used to convert the data object to a readable string format.
return string: A string representing the data object.
std::shared_ptr<NNData> clone(bool deep)
brief: Clone the data object. This is a pure virtual function that requires subclasses to implement it. It is used to create a deep or shallow copy of the data object, depending on the value of the `deep` parameter.
param
deep: A boolean indicating whether to perform a deep clone.
return shared_ptr<NNData>: A shared pointer to the cloned data object.