MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
DebugParameter.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
6using MyCaffe.basecode;
7
8namespace MyCaffe.param
9{
13 [Serializable]
14 [TypeConverter(typeof(ExpandableObjectConverter))]
16 {
17 int m_nMaxBatchesToStore = 1000;
18
21 {
22 }
23
27 [Description("Specifies the maximum number of batches to store and search for neighbors. Each batch input is stored until the maximum count is reached at which time, the oldest batch is released. A larger max value = more GPU memory used.")]
29 {
30 get { return m_nMaxBatchesToStore; }
31 set { m_nMaxBatchesToStore = value; }
32 }
33
35 public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
36 {
37 RawProto proto = RawProto.Parse(br.ReadString());
38 DebugParameter p = FromProto(proto);
39
40 if (!bNewInstance)
41 Copy(p);
42
43 return p;
44 }
45
47 public override void Copy(LayerParameterBase src)
48 {
50 m_nMaxBatchesToStore = p.m_nMaxBatchesToStore;
51 }
52
54 public override LayerParameterBase Clone()
55 {
57 p.Copy(this);
58 return p;
59 }
60
66 public override RawProto ToProto(string strName)
67 {
68 RawProtoCollection rgChildren = new RawProtoCollection();
69
70 rgChildren.Add("max_stored_batches", max_stored_batches.ToString());
71
72 return new RawProto(strName, "", rgChildren);
73 }
74
81 {
82 string strVal;
84
85 if ((strVal = rp.FindValue("max_stored_batches")) != null)
86 p.max_stored_batches = int.Parse(strVal);
87
88 return p;
89 }
90 }
91}
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
static RawProto Parse(string str)
Parses a prototxt and places it in a new RawProto.
Definition: RawProto.cs:306
string FindValue(string strName)
Searches for a falue of a node within this nodes children.
Definition: RawProto.cs:105
Specifies the parameters used by the DebugLayer
int max_stored_batches
Specifies the maximum number of batches to store and search for neighbors. Each batch input is stored...
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
DebugParameter()
Constructor for the parameter.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
static DebugParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
The LayerParameterBase is the base class for all other layer specific parameters.
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