MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
DataDebugParameter.cs
1using MyCaffe.basecode;
2using System;
3using System.Collections.Generic;
5using System.Linq;
6using System.Text;
7using System.Threading.Tasks;
8
9namespace MyCaffe.param
10{
14 [Serializable]
15 [TypeConverter(typeof(ExpandableObjectConverter))]
16 public class DataDebugParameter
17 {
18 int m_nIterations = 1;
19 string m_strDebugDataSavePath = null;
20
25 {
26 }
27
31 [Description("Optionally, specifies the number of iterations for which to output debug information (default = 1)")]
32 public int iterations
33 {
34 get { return m_nIterations; }
35 set { m_nIterations = value; }
36 }
37
41 [Description("Specifies the path where the debug data images are saved (default = null, which ignores this setting).")]
42 public string debug_save_path
43 {
44 get { return m_strDebugDataSavePath; }
45 set { m_strDebugDataSavePath = value; }
46 }
47
48 private string debug_save_path_persist
49 {
50 get
51 {
52 string strPath = Utility.Replace(m_strDebugDataSavePath, ':', ';');
53 return Utility.Replace(strPath, ' ', '~');
54 }
55
56 set
57 {
58 string strPath = Utility.Replace(value, ';', ':');
59 m_strDebugDataSavePath = Utility.Replace(strPath, '~', ' ');
60 }
61 }
62
67 public void Copy(DataDebugParameter src)
68 {
69 if (src == null)
70 return;
71
72 m_nIterations = src.m_nIterations;
73 m_strDebugDataSavePath = src.m_strDebugDataSavePath;
74 }
75
81 public RawProto ToProto(string strName)
82 {
83 RawProtoCollection rgChildren = new RawProtoCollection();
84
85 rgChildren.Add("iterations", m_nIterations.ToString());
86 rgChildren.Add("debug_data_path", debug_save_path_persist);
87
88 return new RawProto(strName, "", rgChildren);
89 }
90
91
99 {
100 string strVal;
101
102 if (p == null)
103 p = new DataDebugParameter();
104
105 if ((strVal = rp.FindValue("iterations")) != null)
106 p.iterations = int.Parse(strVal);
107
108 if ((strVal = rp.FindValue("debug_data_path")) != null)
109 p.debug_save_path_persist = strVal;
110
111 return p;
112 }
113 }
114}
The RawProtoCollection class is a list of RawProto objects.
void Add(RawProto p)
Adds a RawProto to the collection.
The RawProto class is used to parse and output Google prototxt file data.
Definition: RawProto.cs:17
string FindValue(string strName)
Searches for a falue of a node within this nodes children.
Definition: RawProto.cs:105
The Utility class provides general utility funtions.
Definition: Utility.cs:35
static string Replace(string str, char ch1, char ch2)
Replaces each instance of one character with another character in a given string.
Definition: Utility.cs:864
The DataDebugParameter is used by the DataParameter when the 'enable_debugging' = True.
RawProto ToProto(string strName)
Convert the DataDebugParameter into a RawProto.
string debug_save_path
(/b optional, default = null) Specifies the path where the debug data images are saved,...
void Copy(DataDebugParameter src)
Copies the specified source data noise parameter to this one.
static DataDebugParameter FromProto(RawProto rp, DataDebugParameter p=null)
Parses the parameter from a RawProto.
int iterations
(/b optional, default = 1) Specifies the number of iterations to output debug information.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
Definition: Annotation.cs:12
The MyCaffe.param namespace contains parameters used to create models.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...
Definition: Annotation.cs:12