MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
TanhParameter.cs
1using System;
2using System.Collections.Generic;
4using System.Linq;
5using System.Text;
6using MyCaffe.basecode;
7
8namespace MyCaffe.param
9{
18 [Serializable]
19 [TypeConverter(typeof(ExpandableObjectConverter))]
21 {
24 : base()
25 {
26 }
27
32 public string useCaffeReason()
33 {
34 if (engine == Engine.CAFFE)
35 return "The engine setting is set on CAFFE.";
36
37 return "";
38 }
39
44 public bool useCudnn()
45 {
46 if (engine == EngineParameter.Engine.CAFFE)
47 return false;
48
49 return true;
50 }
51
53 public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
54 {
55 RawProto proto = RawProto.Parse(br.ReadString());
56 TanhParameter p = FromProto(proto);
57
58 if (!bNewInstance)
59 Copy(p);
60
61 return p;
62 }
63
65 public override LayerParameterBase Clone()
66 {
68 p.Copy(this);
69 return p;
70 }
71
77 public static new TanhParameter FromProto(RawProto rp)
78 {
80
82
83 return p;
84 }
85 }
86}
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 whether to use the NVIDIA cuDnn version or Caffe version of a given forward/backward operat...
Engine engine
Specifies the Engine in use.
EngineParameter()
Constructor for the parameter.
static EngineParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
Engine
Defines the type of engine to use.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
The LayerParameterBase is the base class for all other layer specific parameters.
Specifies the parameters for the TanhLayer
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.
static new TanhParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
string useCaffeReason()
Returns the reason that Caffe version was used instead of NVIDIA's cuDnn.
bool useCudnn()
Queries whether or not to use NVIDIA's cuDnn.
TanhParameter()
Constructor for the parameter.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
Definition: Annotation.cs:12
The MyCaffe.param namespace contains parameters used to create models.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...
Definition: Annotation.cs:12