2using System.Collections.Generic;
15 [TypeConverter(typeof(ExpandableObjectConverter))]
18 List<uint> m_rgPad =
new List<uint>();
19 List<uint> m_rgStride =
new List<uint>();
20 List<uint> m_rgKernelSize =
new List<uint>();
21 List<uint> m_rgDilation =
new List<uint>();
24 uint? m_nStrideH =
null;
25 uint? m_nStrideW =
null;
26 uint? m_nKernelH =
null;
27 uint? m_nKernelW =
null;
39 [Description(
"Specifies pad given as a single value for equal dimensions in all spatial dimensions, or once per spatial dimension.")]
42 get {
return m_rgPad; }
43 set { m_rgPad = value; }
50 [Description(
"Specifies stride given as a single value for equal dimensions in all spatial dimensions, or once per spatial dimension.")]
53 get {
return m_rgStride; }
54 set { m_rgStride = value; }
61 [Description(
"Specifies kernel size given as a single value for equal dimensions in all spatial dimensions, or once per spatial dimension.")]
64 get {
return m_rgKernelSize; }
65 set { m_rgKernelSize = value; }
80 [Description(
"Specifies dilation given as a single value for equal dimensions in all spatial dimensions, or once per spatial dimension. When specified, this is used to dilate the kernel, (implicitly) zero-filling the resulting holes. (Kernel dilation is sometimes referred to by its use in the algorithm 'a trous from Holschneider et al. 1987.)")]
83 get {
return m_rgDilation; }
84 set { m_rgDilation = value; }
94 [Description(
"Specifies padding height (2D only). 'pad_h' and 'pad_w' are used -or- 'pad' is used, but not both.")]
97 get {
return m_nPadH; }
98 set { m_nPadH = value; }
108 [Description(
"Specifies padding width (2D only). 'pad_h' and 'pad_w' are used -or- 'pad' is used, but not both.")]
111 get {
return m_nPadW; }
112 set { m_nPadW = value; }
122 [Description(
"Specifies stride height (2D only). 'stride_h' and 'stride_w' are used -or- 'stride' is used, but not both.")]
125 get {
return m_nStrideH; }
126 set { m_nStrideH = value; }
136 [Description(
"Specifies stride width (2D only). 'stride_h' and 'stride_w' are used -or- 'stride' is used, but not both.")]
139 get {
return m_nStrideW; }
140 set { m_nStrideW = value; }
150 [Description(
"Specifies kernel size height (2D only). 'kernel_h' and 'kernel_w' are used -or- 'kernel_size' is used, but not both.")]
153 get {
return m_nKernelH; }
154 set { m_nKernelH = value; }
164 [Description(
"Specifies kernel size width (2D only). 'kernel_h' and 'kernel_w' are used -or- 'kernel_size' is used, but not both.")]
167 get {
return m_nKernelW; }
168 set { m_nKernelW = value; }
172 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
191 m_rgPad =
Utility.Clone<uint>(p.m_rgPad);
192 m_rgStride =
Utility.Clone<uint>(p.m_rgStride);
193 m_rgKernelSize =
Utility.Clone<uint>(p.m_rgKernelSize);
194 m_rgDilation =
Utility.Clone<uint>(p.m_rgDilation);
197 m_nStrideH = p.m_nStrideH;
198 m_nStrideW = p.m_nStrideW;
199 m_nKernelH = p.m_nKernelH;
200 m_nKernelW = p.m_nKernelW;
219 RawProto rpBase = base.ToProto(
"engine");
223 rgChildren.
Add<uint>(
"kernel_size", m_rgKernelSize);
224 rgChildren.
Add<uint>(
"stride", m_rgStride);
225 rgChildren.
Add<uint>(
"pad", m_rgPad);
227 if (m_rgDilation.Count > 0)
228 rgChildren.
Add<uint>(
"dilation", m_rgDilation);
230 rgChildren.
Add(
"kernel_h", m_nKernelH);
231 rgChildren.
Add(
"kernel_w", m_nKernelW);
232 rgChildren.
Add(
"stride_h", m_nStrideH);
233 rgChildren.
Add(
"stride_w", m_nStrideW);
234 rgChildren.
Add(
"pad_h", m_nPadH);
235 rgChildren.
Add(
"pad_w", m_nPadW);
237 return new RawProto(strName,
"", rgChildren);
251 p.m_rgPad = rp.FindArray<uint>(
"pad");
252 p.m_rgStride = rp.FindArray<uint>(
"stride");
253 p.m_rgKernelSize = rp.FindArray<uint>(
"kernel_size");
254 p.m_rgDilation = rp.FindArray<uint>(
"dilation");
255 p.m_nPadH = (uint?)rp.
FindValue(
"pad_h", typeof(uint));
256 p.m_nPadW = (uint?)rp.
FindValue(
"pad_w", typeof(uint));
257 p.m_nStrideH = (uint?)rp.
FindValue(
"stride_h", typeof(uint));
258 p.m_nStrideW = (uint?)rp.
FindValue(
"stride_w", typeof(uint));
259 p.m_nKernelH = (uint?)rp.
FindValue(
"kernel_h", typeof(uint));
260 p.m_nKernelW = (uint?)rp.
FindValue(
"kernel_w", typeof(uint));
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.
RawProtoCollection Children
Returns a collection of this nodes child nodes.
static RawProto Parse(string str)
Parses a prototxt and places it in a new RawProto.
string FindValue(string strName)
Searches for a falue of a node within this nodes children.
The Utility class provides general utility funtions.
Specifies whether to use the NVIDIA cuDnn version or Caffe version of a given forward/backward operat...
EngineParameter()
Constructor for the parameter.
static EngineParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
Specifies the basic kernel parameters (used by convolution and pooling)
uint? stride_h
The stride height (2D only)
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
List< uint > kernel_size
Kernel size is given as a single value for equal dimensions in all spatial dimensions,...
static new KernelParameter FromProto(RawProto rp)
Parse a RawProto into a new instance of the parameter.
List< uint > dilation
Factor used to dilate the kernel, (implicitly) zero-filling the resulting holes. (Kernel dilation is ...
uint? stride_w
The stride width (2D only)
override void Copy(LayerParameterBase src)
Copy on parameter to another.
uint? pad_h
The padding height (2D only)
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
uint? kernel_h
The kernel height (2D only)
List< uint > stride
Stride is given as a single value for equal dimensions in all spatial dimensions, or once per spatial...
uint? kernel_w
The kernel width (2D only)
KernelParameter()
Constructor for the parameter.
uint? pad_w
The padding width (2D only)
List< uint > pad
Pad is given as a single value for equal dimensions in all spatial dimensions, or once per spatial di...
The LayerParameterBase is the base class for all other layer specific parameters.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.common namespace contains common MyCaffe classes.
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-...