MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
TransposeParameter.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>() { 0, 1, 2, 3 }; // By default, set to identity for n,c,h,w.
23 }
24
34 [Description("Specifies the dimensions to transpose.")]
35 public List<int> dim
36 {
37 get { return m_shape.dim; }
38 set { m_shape.dim = value; }
39 }
40
42 public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
43 {
44 RawProto proto = RawProto.Parse(br.ReadString());
46
47 if (!bNewInstance)
48 Copy(p);
49
50 return p;
51 }
52
54 public override void Copy(LayerParameterBase src)
55 {
57 m_shape = p.m_shape.Clone();
58 }
59
61 public override LayerParameterBase Clone()
62 {
64 p.Copy(this);
65 return p;
66 }
67
73 public override RawProto ToProto(string strName)
74 {
75 return m_shape.ToProto(strName);
76 }
77
84 {
86 p.m_shape = BlobShape.FromProto(rp);
87
88 return p;
89 }
90 }
91}
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 TransposeLayer.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
static TransposeParameter 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.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
List< int > dim
Specifies the dimensions to transpose.
TransposeParameter()
Constructor for the parameter.
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