MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
SilenceLayer.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using MyCaffe.basecode;
6using MyCaffe.common;
7using MyCaffe.param;
8
9namespace MyCaffe.layers
10{
16 public class SilenceLayer<T> : Layer<T>
17 {
25 : base(cuda, log, p)
26 {
28 }
29
33 public override int MinBottomBlobs
34 {
35 get { return 1; }
36 }
37
41 public override int ExactNumTopBlobs
42 {
43 get { return 0; }
44 }
45
47 public override void LayerSetUp(BlobCollection<T> colBottom, BlobCollection<T> colTop)
48 {
49 }
50
52 public override void Reshape(BlobCollection<T> colBottom, BlobCollection<T> colTop)
53 {
54 }
55
57 protected override void forward(BlobCollection<T> colBottom, BlobCollection<T> colTop)
58 {
59 }
60
69 protected override void backward(BlobCollection<T> colTop, List<bool> rgbPropagateDown, BlobCollection<T> colBottom)
70 {
71 for (int i = 0; i < colBottom.Count; i++)
72 {
73 if (rgbPropagateDown[i])
74 {
75 colBottom[i].SetDiff(0);
76 }
77 }
78 }
79 }
80}
The Log class provides general output in text form.
Definition: Log.cs:13
The BlobCollection contains a list of Blobs.
void SetDiff(double df)
Set all blob diff to the value specified.
int Count
Returns the number of items in the collection.
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
LayerParameter.LayerType m_type
Specifies the Layer type.
Definition: Layer.cs:35
The SilenceLayer ignores bottom blobs while producing no top blobs. (This is useuful to suppress outp...
Definition: SilenceLayer.cs:17
override int MinBottomBlobs
Returns the minimum number of required bottom (input) Blobs: input.
Definition: SilenceLayer.cs:34
override void backward(BlobCollection< T > colTop, List< bool > rgbPropagateDown, BlobCollection< T > colBottom)
The backward computation merely sets the bottom diff to zero.
Definition: SilenceLayer.cs:69
override int ExactNumTopBlobs
Returns 0 as this layer has no output.
Definition: SilenceLayer.cs:42
override void Reshape(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Not implemented - no reshape needed.
Definition: SilenceLayer.cs:52
override void forward(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Not implemented - no output.
Definition: SilenceLayer.cs:57
SilenceLayer(CudaDnn< T > cuda, Log log, LayerParameter p)
The SilenceLayer constructor.
Definition: SilenceLayer.cs:24
override void LayerSetUp(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Not implemented - no setup needed.
Definition: SilenceLayer.cs:47
Specifies the base parameter for all layers.
LayerType
Specifies the layer type.
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.layers namespace contains all layers that have a solidified code base,...
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