MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
ConvolutionOctaveParameter.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
6using MyCaffe.basecode;
7
8namespace MyCaffe.param
9{
15 [Serializable]
16 [TypeConverter(typeof(ExpandableObjectConverter))]
18 {
19 double m_dfAlphaIn = 0.5;
20 double m_dfAlphaOut = 0.5;
21
24 {
25 }
26
30 [Description("Specifies the alpha applied to the input channels.")]
31 public double alpha_in
32 {
33 get { return m_dfAlphaIn; }
34 set { m_dfAlphaIn = value; }
35 }
36
40 [Description("Specifies the alpha applied to the output channels.")]
41 public double alpha_out
42 {
43 get { return m_dfAlphaOut; }
44 set { m_dfAlphaOut = value; }
45 }
46
48 public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
49 {
50 RawProto proto = RawProto.Parse(br.ReadString());
52
53 if (!bNewInstance)
54 Copy(p);
55
56 return p;
57 }
58
60 public override void Copy(LayerParameterBase src)
61 {
63 {
65 m_dfAlphaIn = p.alpha_in;
66 m_dfAlphaOut = p.alpha_out;
67 }
68 }
69
71 public override LayerParameterBase Clone()
72 {
74 p.Copy(this);
75 return p;
76 }
77
83 public override RawProto ToProto(string strName)
84 {
85 RawProtoCollection rgChildren = new RawProtoCollection();
86
87 rgChildren.Add("alpha_in", alpha_in.ToString());
88 rgChildren.Add("alpha_out", alpha_out.ToString());
89
90 return new RawProto(strName, "", rgChildren);
91 }
92
99 {
100 string strVal;
102
103 if ((strVal = rp.FindValue("alpha_in")) != null)
104 p.alpha_in = double.Parse(strVal);
105
106 if ((strVal = rp.FindValue("alpha_out")) != null)
107 p.alpha_out = double.Parse(strVal);
108
109 return p;
110 }
111 }
112}
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 for the ConvolutionOctaveLayer.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
static ConvolutionOctaveParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
ConvolutionOctaveParameter()
Constructor for the parameter.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
double alpha_out
Specifies alpha applied to the output channels.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
double alpha_in
Specifies alpha applied to the input channels.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
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