2using System.Collections.Generic;
19 [TypeConverter(typeof(ExpandableObjectConverter))]
22 double m_dfEpsilon = 1e-10;
23 bool m_bEnableCudaImplementation =
false;
24 bool m_bEnablePassThrough =
false;
34 [Description(
"Specifies the epsilon value used to avoid invalid values (default = 1e-10).")]
37 get {
return m_dfEpsilon; }
38 set { m_dfEpsilon = value; }
44 [Description(
"Specifies to pass-through the data on the forward and backward pass (e.g. skip the layer norm, used only for debugging. default = false).")]
47 get {
return m_bEnablePassThrough; }
48 set { m_bEnablePassThrough = value; }
57 [Description(
"Specifies to use the low-level full cuda implementation of LayerNorm (default = false).")]
60 get {
return m_bEnableCudaImplementation; }
61 set { m_bEnableCudaImplementation = value; }
70 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
113 rgChildren.
Add(
"epsilon", m_dfEpsilon.ToString());
114 rgChildren.
Add(
"enable_cuda_impl", m_bEnableCudaImplementation.ToString());
116 if (m_bEnablePassThrough)
117 rgChildren.
Add(
"enable_passthrough", m_bEnablePassThrough.ToString());
119 return new RawProto(strName,
"", rgChildren);
132 if ((strVal = rp.
FindValue(
"epsilon")) !=
null)
133 p.m_dfEpsilon =
double.Parse(strVal);
135 if ((strVal = rp.
FindValue(
"enable_cuda_impl")) !=
null)
136 p.m_bEnableCudaImplementation =
bool.Parse(strVal);
138 if ((strVal = rp.
FindValue(
"enable_passthrough")) !=
null)
139 p.m_bEnablePassThrough =
bool.Parse(strVal);
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.
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 LayerParameterBase is the base class for all other layer specific parameters.
Specifies the parameters for the LayerNormalizationLayer.
static LayerNormParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
LayerNormParameter()
Constructor for the parameter.
bool enable_passthrough
Specifies to pass-through the data on the forward and backward pass (e.g. skip the layer norm,...
bool enable_cuda_impl
Specifies to use the low-level full cuda implementation of LayerNorm (default = false).
double epsilon
Specifies the epsilon value used to avoid invalid values (default = 1e-10).
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 LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...