MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
GateAddNormParameter.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
6using MyCaffe.basecode;
7using static MyCaffe.param.tft.GluParameter;
8
9namespace MyCaffe.param.tft
10{
25 [Serializable]
26 [TypeConverter(typeof(ExpandableObjectConverter))]
28 {
29 int m_nResidualChannelOffset = 0;
30
33 {
34 }
35
39 [Description("Specifies the residual channel offset used to copy only the latter portions of the residual (default = 0 which uses all of the residual).")]
41 {
42 get { return m_nResidualChannelOffset; }
43 set { m_nResidualChannelOffset = value; }
44 }
45
47 public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
48 {
49 RawProto proto = RawProto.Parse(br.ReadString());
51
52 if (!bNewInstance)
53 Copy(p);
54
55 return p;
56 }
57
59 public override void Copy(LayerParameterBase src)
60 {
62
63 m_nResidualChannelOffset = p.residual_channel_offset;
64 }
65
67 public override LayerParameterBase Clone()
68 {
70 p.Copy(this);
71 return p;
72 }
73
79 public override RawProto ToProto(string strName)
80 {
81 RawProtoCollection rgChildren = new RawProtoCollection();
82
83 rgChildren.Add("residual_channel_offset", residual_channel_offset.ToString());
84
85 return new RawProto(strName, "", rgChildren);
86 }
87
94 {
95 string strVal;
97
98 if ((strVal = rp.FindValue("residual_channel_offset")) != null)
99 p.residual_channel_offset = int.Parse(strVal);
100
101 return p;
102 }
103 }
104}
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
The LayerParameterBase is the base class for all other layer specific parameters.
Specifies the parameters for the GetAddNormLayer (Gate Add Norm).
static GateAddNormParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
int residual_channel_offset
Specifies the residual channel offset used to copy only the latter portions of the residual (default ...
GateAddNormParameter()
Constructor for the parameter.
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.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
Specifies the parameters for the GluLayer (Gated Linear Unit).
Definition: GluParameter.cs:28
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