MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
QuantileLossParameter.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
6using MyCaffe.basecode;
7
8namespace MyCaffe.param.tft
9{
18 [Serializable]
19 [TypeConverter(typeof(ExpandableObjectConverter))]
21 {
22 List<float> m_rgDesiredQuantiles = new List<float>();
23
26 {
27 }
28
32 [Description("Specifies the desired quantiles.")]
33 public List<float> desired_quantiles
34 {
35 get { return m_rgDesiredQuantiles; }
36 set { m_rgDesiredQuantiles = value; }
37 }
38
40 public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
41 {
42 RawProto proto = RawProto.Parse(br.ReadString());
44
45 if (!bNewInstance)
46 Copy(p);
47
48 return p;
49 }
50
52 public override void Copy(LayerParameterBase src)
53 {
55 m_rgDesiredQuantiles = Utility.Clone<float>(p.desired_quantiles);
56 }
57
59 public override LayerParameterBase Clone()
60 {
62 p.Copy(this);
63 return p;
64 }
65
71 public override RawProto ToProto(string strName)
72 {
73 RawProtoCollection rgChildren = new RawProtoCollection();
74
75 rgChildren.Add<float>("desired_quantile", desired_quantiles);
76
77 return new RawProto(strName, "", rgChildren);
78 }
79
86 {
88
89 p.desired_quantiles = rp.FindArray<float>("desired_quantile");
90
91 return p;
92 }
93 }
94}
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
The Utility class provides general utility funtions.
Definition: Utility.cs:35
The LayerParameterBase is the base class for all other layer specific parameters.
Specifies the parameters for the QuantileLossLayer used in TFT models
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
static QuantileLossParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
List< float > desired_quantiles
Specifies the desired quantiles.
QuantileLossParameter()
Constructor for the parameter.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
Definition: Annotation.cs:12
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...
Definition: Annotation.cs:12