MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
SqueezeParameter.cs
1using System;
2using System.Collections.Generic;
4using System.Linq;
5using System.Text;
6using MyCaffe.basecode;
7
8namespace MyCaffe.param.beta
9{
13 [Serializable]
14 [TypeConverter(typeof(ExpandableObjectConverter))]
16 {
17 BlobShape m_shape = new BlobShape();
18
21 {
22 m_shape.dim = new List<int>();
23 }
24
31 [Description("Specifies the axes to remove if dim=1 on squeeze, or add dim=1 on unsqueeze.")]
32 public List<int> axes
33 {
34 get { return m_shape.dim; }
35 set { m_shape.dim = value; }
36 }
37
39 public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
40 {
41 RawProto proto = RawProto.Parse(br.ReadString());
42 SqueezeParameter p = FromProto(proto);
43
44 if (!bNewInstance)
45 Copy(p);
46
47 return p;
48 }
49
51 public override void Copy(LayerParameterBase src)
52 {
54 m_shape = p.m_shape.Clone();
55 }
56
58 public override LayerParameterBase Clone()
59 {
61 p.Copy(this);
62 return p;
63 }
64
70 public override RawProto ToProto(string strName)
71 {
72 return m_shape.ToProto(strName);
73 }
74
81 {
83 p.m_shape = BlobShape.FromProto(rp);
84
85 return p;
86 }
87 }
88}
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
Specifies the shape of a Blob.
Definition: BlobShape.cs:15
override RawProto ToProto(string strName)
Converts the BlobShape to a RawProto.
Definition: BlobShape.cs:153
BlobShape Clone()
Creates a copy of the BlobShape.
Definition: BlobShape.cs:102
static BlobShape FromProto(RawProto rp)
Parse a new BlobShape from a RawProto.
Definition: BlobShape.cs:167
List< int > dim
The blob shape dimensions.
Definition: BlobShape.cs:93
The LayerParameterBase is the base class for all other layer specific parameters.
Specifies the parameters for the SqueezeLayer.
static SqueezeParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
SqueezeParameter()
Constructor for the parameter.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
List< int > axes
Specifies the axes to remove if dim=1 on squeeze, or add dim=1 on unsqueeze.
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.param.beta parameters are used by the MyCaffe.layer.beta layers.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...
Definition: Annotation.cs:12