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.StartsWith(
"MODEL") ? true :
false; }
184 if (str.IndexOf(
"GYM:") == 0)
200 if (str.StartsWith(
"MODEL"))
202 if (str.Contains(
":TEMPORAL"))
216 public static string GetGymName(
string str, out
string strType)
220 int nPos = str.IndexOf(
"GYM:");
224 str = str.Substring(4);
226 nPos = str.IndexOf(
':');
230 strType = str.Substring(nPos + 1);
231 return str.Substring(0, nPos);
237 [Category(
"Groups"),
Description(
"Specifies the dataset group (if any).")]
240 get {
return m_groupDataset; }
246 [Category(
"Groups"),
Description(
"Specifies the model group (if any).")]
249 get {
return m_groupModel; }
250 set { m_groupModel = value; }
256 [Category(
"Sources"),
Description(
"Specifies the data source used when training.")]
259 get {
return m_srcTrain; }
260 set { m_srcTrain = value; }
266 [Category(
"Sources"),
Description(
"Specifies the data source used when testing.")]
269 get {
return m_srcTest; }
270 set { m_srcTest = value; }
279 get {
return (m_srcTrain ==
null) ? null : m_srcTrain.
Name; }
288 get {
return (m_srcTest ==
null) ? null : m_srcTest.
Name; }
294 [
Description(
"Specifies the name of the creator used to create this dataset.")]
297 get {
return m_strCreatorName; }
303 [
Description(
"Specifies the description of this dataset.")]
306 get {
return m_strDescription; }
307 set { m_strDescription = value; }
313 [
Description(
"Specifies the parameters of the data set (if any).")]
316 get {
return m_colParameters; }
317 set { m_colParameters = value; }
327 using (MemoryStream ms =
new MemoryStream())
329 BinaryFormatter bf =
new BinaryFormatter();
330 bf.Serialize(ms, ds);
343 using (MemoryStream ms =
new MemoryStream(rg))
345 BinaryFormatter bf =
new BinaryFormatter();
356 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.
bool IsDataTemporal
Returns whether or not this dataset is from the model itself and is temporal.
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.
static bool IsModelDataName(string str, out bool bTemporal)
Returns whether or not the name directs to use data from the model itself.
void Resize(int nChannels, int nHeight, int nWidth)
Resize the testing and training data sources.
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.
TemporalDescriptor TemporalDescriptor
Get/set the temporal descriptor (if any).
The descriptors namespace contains all descriptor used to describe various items stored within the da...
GYM_TYPE
Defines the gym type (if any).