/// <summary> /// The ProjectDescriptor constructor. /// </summary> /// <param name="nID">Specifies the database ID of the item.</param> /// <param name="strName">Specifies the name of the item.</param> /// <param name="ds">Specifies the dataset used.</param> /// <param name="grp">Specifies the project group.</param> /// <param name="strSolverName">Specifies the solver name.</param> /// <param name="strSolverDesc">Specifies the solver description script.</param> /// <param name="strModelName">Specifies the model name.</param> /// <param name="strModelDesc">Specifies the model description script.</param> /// <param name="strGpuOverride">Specifies the GPU ID's to use as an override.</param> /// <param name="nTotalIterations">Specifies the total number of iterations.</param> /// <param name="bActive">Specifies whether or not the project is active.</param> /// <param name="settings">Specifies the settings to use.</param> /// <param name="strOwner">Specifies the identifier of the item's owner.</param> public ProjectDescriptor(int nID, string strName, DatasetDescriptor ds, GroupDescriptor grp, string strSolverName, string strSolverDesc, string strModelName, string strModelDesc, string strGpuOverride, int nTotalIterations, bool bActive, SettingsCaffe settings, string strOwner) : base(nID, strName, strOwner) { if (settings != null) { m_settings = settings.Clone(); } if (ds != null) { m_dataset = new DatasetDescriptor(ds); } if (grp != null) { m_group = new GroupDescriptor(grp); } else { m_group = new GroupDescriptor(0, null, null); } m_strSolverName = strSolverName; m_strSolverDescription = strSolverDesc; m_strModelName = strModelName; m_strModelDescription = strModelDesc; m_bActive = bActive; m_nTotalIterations = nTotalIterations; m_strGpuOverride = strGpuOverride; }
/// <summary> /// Serialize a dataset descriptor to a byte array. /// </summary> /// <param name="ds">Specifies the dataset descriptor to serialize.</param> /// <returns>A byte array containing the serialized dataset is returned.</returns> public static byte[] Serialize(DatasetDescriptor ds) { using (MemoryStream ms = new MemoryStream()) { BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(ms, ds); ms.Flush(); return(ms.ToArray()); } }
/// <summary> /// Copy another DatasetDesciptor into this one. /// </summary> /// <param name="ds">Specifies the DatasetDesciptor to copy.</param> public void Copy(DatasetDescriptor ds) { base.Copy(ds); m_gymType = ds.m_gymType; if (ds.m_srcTest != null) { m_srcTest = new SourceDescriptor(ds.m_srcTest); } else { m_srcTest = null; } if (ds.m_srcTrain != null) { m_srcTrain = new SourceDescriptor(ds.m_srcTrain); } else { m_srcTrain = null; } if (ds.m_groupDataset != null) { m_groupDataset = new GroupDescriptor(ds.m_groupDataset); } else { m_groupDataset = null; } if (ds.m_groupModel != null) { m_groupModel = new GroupDescriptor(ds.m_groupModel); } else { m_groupModel = null; } m_colParameters = new descriptors.ParameterDescriptorCollection(); foreach (ParameterDescriptor p in ds.m_colParameters) { m_colParameters.Add(new ParameterDescriptor(p)); } m_strCreatorName = ds.m_strCreatorName; m_strDescription = ds.m_strDescription; }
/// <summary> /// The DatasetDescriptor constructor. /// </summary> /// <param name="d">Specifies another DatasetDesciptor used to create this one.</param> public DatasetDescriptor(DatasetDescriptor d) : this(d.ID, d.Name, d.ModelGroup, d.DatasetGroup, d.TrainingSource, d.TestingSource, d.CreatorName, d.Description, d.Owner, d.GymType) { m_colParameters = new ParameterDescriptorCollection(d.Parameters); }
/// <summary> /// The ProjectDescriptor constructor. /// </summary> /// <param name="p">Specifies another ProjectDescriptor used to create this one.</param> public ProjectDescriptor(ProjectDescriptor p) : this(p.ID, p.Name, p.Dataset, p.Group, p.m_strSolverName, p.SolverDescription, p.m_strModelName, p.ModelDescription, p.GpuOverride, p.TotalIterations, p.Active, p.Settings, p.Owner) { m_datasetTarget = p.DatasetTarget; }