MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
LayerFactory.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using MyCaffe.basecode;
7using MyCaffe.common;
8using MyCaffe.db.image;
9using MyCaffe.param;
10
15{
20 {
31 {
32 switch (p.type)
33 {
35 return new CfcLayer<double>(cuda, log, p);
36
37 case LayerParameter.LayerType.CFC_UNIT:
38 return new CfcUnitLayer<double>(cuda, log, p);
39
40 case LayerParameter.LayerType.LTC_UNIT:
41 return new LtcUnitLayer<double>(cuda, log, p);
42
43 case LayerParameter.LayerType.LECUN:
44 return new LeCunLayer<double>(cuda, log, p);
45
46 case LayerParameter.LayerType.SILU:
47 return new SiLULayer<double>(cuda, log, p);
48
49 case LayerParameter.LayerType.SOFTPLUS:
50 return new SoftPlusLayer<double>(cuda, log, p);
51
52 default:
53 return null;
54 }
55 }
56
67 {
68 switch (p.type)
69 {
71 return new CfcLayer<float>(cuda, log, p);
72
73 case LayerParameter.LayerType.CFC_UNIT:
74 return new CfcUnitLayer<float>(cuda, log, p);
75
76 case LayerParameter.LayerType.LTC_UNIT:
77 return new LtcUnitLayer<float>(cuda, log, p);
78
79 case LayerParameter.LayerType.LECUN:
80 return new LeCunLayer<float>(cuda, log, p);
81
82 case LayerParameter.LayerType.SILU:
83 return new SiLULayer<float>(cuda, log, p);
84
85 case LayerParameter.LayerType.SOFTPLUS:
86 return new SoftPlusLayer<float>(cuda, log, p);
87
88 default:
89 return null;
90 }
91 }
92 }
93}
The CancelEvent provides an extension to the manual cancel event that allows for overriding the manua...
Definition: CancelEvent.cs:17
The Log class provides general output in text form.
Definition: Log.cs:13
The CudaDnn object is the main interface to the Low-Level Cuda C++ DLL.
Definition: CudaDnn.cs:969
An interface for the units of computation which can be composed into a Net.
Definition: Layer.cs:31
The CfcLayer implements the Closed form Continuous layer.
Definition: CfcLayer.cs:24
The CfcUnitLayer implements the Closed form Continuous Cell (CfcCell) layer.
Definition: CfcUnitLayer.cs:24
The LayerFactor is responsible for creating all layers implemented in the MyCaffe....
Definition: LayerFactory.cs:20
Layer< float > CreateSingle(CudaDnn< float > cuda, Log log, LayerParameter p, CancelEvent evtCancel, IXDatabaseBase db)
Create the layers when using the float base type.
Definition: LayerFactory.cs:66
Layer< double > CreateDouble(CudaDnn< double > cuda, Log log, LayerParameter p, CancelEvent evtCancel, IXDatabaseBase db)
Create the layers when using the double base type.
Definition: LayerFactory.cs:30
The LeCunLayer performs the LeCun's Tanh function
Definition: LeCunLayer.cs:22
The LtcUnitLayer implements the liquid time constant with ODE solver (LTCCell) layer.
Definition: LtcUnitLayer.cs:25
The SiLULayer implements the Sigmoid-weighted Linear Unit (SiLU) activation function
Definition: SiluLayer.cs:22
The SoftPlusLayer implements the Softplus function, a smooth approximation of the ReLU function
Specifies the base parameter for all layers.
LayerType type
Specifies the type of this LayerParameter.
LayerType
Specifies the layer type.
The ILayerCreator interface is implemented by each MyCaffe.layers.x layer extension dll and is used t...
Definition: Interfaces.cs:19
The IXDatabaseBase interface defines the general interface to the in-memory database.
Definition: Interfaces.cs:444
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
Definition: Annotation.cs:12
The MyCaffe.common namespace contains common MyCaffe classes.
Definition: BatchInput.cs:8
The MyCaffe.db.image namespace contains all image database related classes.
Definition: Database.cs:18
The MyCaffe.layers.lnn namespace contains all Liquid Neural Network (LNN) related layers.
Definition: LayerFactory.cs:15
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