2using System.Collections.Generic;
6using System.Runtime.Serialization.Formatters.Binary;
8using System.Threading.Tasks;
16 [TypeConverter(typeof(ExpandableObjectConverter))]
24 string m_strCreatorName;
25 string m_strDescription;
42 : base(nID, strName, strOwner)
62 m_strDescription = strDescription;
63 m_strCreatorName = strCreatorName;
71 : this(0, strName, null, null, null, null, null,
"")
91 public void Resize(
int nChannels,
int nHeight,
int nWidth)
93 m_srcTest.
Resize(nChannels, nHeight, nWidth);
94 m_srcTrain.
Resize(nChannels, nHeight, nWidth);
105 m_gymType = ds.m_gymType;
107 if (ds.m_srcTest !=
null)
112 if (ds.m_srcTrain !=
null)
117 if (ds.m_groupDataset !=
null)
120 m_groupDataset =
null;
122 if (ds.m_groupModel !=
null)
133 m_strCreatorName = ds.m_strCreatorName;
134 m_strDescription = ds.m_strDescription;
142 get {
return (m_gymType ==
GYM_TYPE.NONE) ? false :
true; }
150 get {
return m_gymType; }
158 get {
return (
Name ==
"MODEL") ? true :
false; }
176 if (str.IndexOf(
"GYM:") == 0)
201 public static string GetGymName(
string str, out
string strType)
205 int nPos = str.IndexOf(
"GYM:");
209 str = str.Substring(4);
211 nPos = str.IndexOf(
':');
215 strType = str.Substring(nPos + 1);
216 return str.Substring(0, nPos);
222 [Category(
"Groups"),
Description(
"Specifies the dataset group (if any).")]
225 get {
return m_groupDataset; }
231 [Category(
"Groups"),
Description(
"Specifies the model group (if any).")]
234 get {
return m_groupModel; }
235 set { m_groupModel = value; }
241 [Category(
"Sources"),
Description(
"Specifies the data source used when training.")]
244 get {
return m_srcTrain; }
245 set { m_srcTrain = value; }
251 [Category(
"Sources"),
Description(
"Specifies the data source used when testing.")]
254 get {
return m_srcTest; }
255 set { m_srcTest = value; }
264 get {
return (m_srcTrain ==
null) ? null : m_srcTrain.
Name; }
273 get {
return (m_srcTest ==
null) ? null : m_srcTest.
Name; }
279 [
Description(
"Specifies the name of the creator used to create this dataset.")]
282 get {
return m_strCreatorName; }
288 [
Description(
"Specifies the description of this dataset.")]
291 get {
return m_strDescription; }
292 set { m_strDescription = value; }
298 [
Description(
"Specifies the parameters of the data set (if any).")]
301 get {
return m_colParameters; }
302 set { m_colParameters = value; }
312 using (MemoryStream ms =
new MemoryStream())
314 BinaryFormatter bf =
new BinaryFormatter();
315 bf.Serialize(ms, ds);
328 using (MemoryStream ms =
new MemoryStream(rg))
330 BinaryFormatter bf =
new BinaryFormatter();
341 return m_strCreatorName +
":" +
Name;
The BaseDescriptor is the base class for all other descriptors, where descriptors are used to describ...
string Owner
Get/set the owner of the item.
int ID
Get/set the database ID of the item.
string Name
Get/set the name of the item.
The DatasetDescriptor class describes a dataset which contains both a training data source and testin...
GroupDescriptor DatasetGroup
Returns the dataset group.
bool? IsGym
Returns whether or not this dataset is from a Gym.
SourceDescriptor TrainingSource
Get/set the training data source.
static DatasetDescriptor Deserialize(byte[] rg)
Deserialize a dataset descriptor from a byte array.
GroupDescriptor ModelGroup
Get/set the dataset model group.
string? TrainingSourceName
Returns the training source name, or null if not specifies.
bool? IsModelData
Returns whether or not this dataset is from the model itself.
string CreatorName
Returns the dataset creator name.
SourceDescriptor TestingSource
Get/set the testing data source.
string? TestingSourceName
Returns the testing source name or null if not specified.
static bool IsGymName(string str)
Returns whether or not the name is from a gym.
DatasetDescriptor(string strName)
The DatasetDescriptor constructor.
static byte[] Serialize(DatasetDescriptor ds)
Serialize a dataset descriptor to a byte array.
string? FullName
Returns the full name which returns 'GYM:Name:Type' when using a gym based dataset,...
GYM_TYPE GymType
Returns the Gym type, if any.
void Resize(int nChannels, int nHeight, int nWidth)
Resize the testing and training data sources.
static bool IsModelDataName(string str)
Returns whether or not the name directs to use data from the model itself.
ParameterDescriptorCollection Parameters
Get/set the dataset parameters (if any).
static string GetGymName(string str, out string strType)
Returns the actual gym name by parsing off the 'GYM:' if it exists.
DatasetDescriptor(DatasetDescriptor d)
The DatasetDescriptor constructor.
string Description
Get/set the description of the Dataset.
override string ToString()
Creates the string representation of the descriptor.
DatasetDescriptor(int nID, string strName, GroupDescriptor grpModel, GroupDescriptor grpDs, SourceDescriptor srcTrain, SourceDescriptor srcTest, string strCreatorName, string strDescription, string strOwner=null, GYM_TYPE gymType=GYM_TYPE.NONE)
The DatasetDescriptor constructor.
void Copy(DatasetDescriptor ds)
Copy another DatasetDesciptor into this one.
The GroupDescriptor class defines a group.
GroupDescriptor(int nID, string strName, string strOwner)
The GroupDescriptor constructor.
The ParameterDescriptorCollection class contains a list of ParameterDescriptor's.
void Add(ParameterDescriptor p)
Adds a ParameterDescriptor to the collection.
ParameterDescriptorCollection()
The ParameterDescriptorCollection constructor.
The ParameterDescriptor class describes a parameter in the database.
The SourceDescriptor class contains all information describing a data source.
void Resize(int nChannels, int nHeight, int nWidth)
Resize the testing and training data sources.
The descriptors namespace contains all descriptor used to describe various items stored within the da...
GYM_TYPE
Defines the gym type (if any).