MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
QuantileAccuracyParameter.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
6using MyCaffe.basecode;
7
8namespace MyCaffe.param.tft
9{
16 [Serializable]
17 [TypeConverter(typeof(ExpandableObjectConverter))]
19 {
20 List<float> m_rgAccuracyRanges = new List<float>();
21 uint m_nAveragePeriod = 30;
22
25 {
26 }
27
31 [Description("Specifies the quantile ranges from center to check for predicted values against target values. The number of target values falling within the center +/- each quantile accuracy range defines the accuracy.")]
32 public List<float> accuracy_ranges
33 {
34 get { return m_rgAccuracyRanges; }
35 set { m_rgAccuracyRanges = value; }
36 }
37
41 [Description("Specifies the period over which the accuracy is averaged (default = 30).")]
42 public uint average_period
43 {
44 get { return m_nAveragePeriod; }
45 set { m_nAveragePeriod = value; }
46 }
47
49 public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
50 {
51 RawProto proto = RawProto.Parse(br.ReadString());
53
54 if (!bNewInstance)
55 Copy(p);
56
57 return p;
58 }
59
61 public override void Copy(LayerParameterBase src)
62 {
64 m_rgAccuracyRanges = Utility.Clone<float>(p.accuracy_ranges);
65 m_nAveragePeriod = p.m_nAveragePeriod;
66 }
67
69 public override LayerParameterBase Clone()
70 {
72 p.Copy(this);
73 return p;
74 }
75
81 public override RawProto ToProto(string strName)
82 {
83 RawProtoCollection rgChildren = new RawProtoCollection();
84
85 rgChildren.Add<float>("accuracy_range", accuracy_ranges);
86 rgChildren.Add("average_period", average_period.ToString());
87
88 return new RawProto(strName, "", rgChildren);
89 }
90
97 {
98 string strVal;
100
101 p.accuracy_ranges = rp.FindArray<float>("accuracy_range");
102
103 if ((strVal = rp.FindValue("average_period")) != null)
104 p.average_period = uint.Parse(strVal);
105
106 return p;
107 }
108 }
109}
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 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 QuantileAccuracyLayer used in TFT models
QuantileAccuracyParameter()
Constructor for the parameter.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
static QuantileAccuracyParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
List< float > accuracy_ranges
Specifies the quantile ranges from center to check for predicted values against target values....
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
uint average_period
Specifies the period over which the accuracy is averaged (default = 30).
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