2using System.Collections.Generic;
5using System.Threading.Tasks;
18 double m_dfExtraInfo = 0;
20 bool m_bDetectNans =
false;
21 List<LayerDebugInformation<T>> m_rgLayerInfo =
new List<LayerDebugInformation<T>>();
33 m_bDetectNans = bDetectNans;
41 if (m_blobWork !=
null)
57 if (layer.
Name == strLayer)
80 get {
return m_strName; }
88 get {
return m_dfExtraInfo; }
89 set { m_dfExtraInfo = value; }
97 get {
return m_rgLayerInfo; }
107 if (dbg.
Name != m_strName)
110 if (dbg.m_rgLayerInfo.Count != m_rgLayerInfo.Count)
113 for (
int i = 0; i < m_rgLayerInfo.Count; i++)
115 if (!dbg.m_rgLayerInfo[i].Compare(m_rgLayerInfo[i]))
129 for (
int i = 0; i< m_rgLayerInfo.Count; i++)
134 if (strBlobNan !=
null)
149 for (
int i = m_rgLayerInfo.Count - 1; i >= 0; i--)
154 if (strBlobNan !=
null)
180 double m_dfForwardTiming = 0;
181 double m_dfForwardTimingAve = 0;
182 double m_dfBackwardTiming = 0;
183 double m_dfBackwardTimingAve = 0;
184 List<BlobDebugInformation<T>> m_rgBlobInfo =
new List<BlobDebugInformation<T>>();
197 m_strType = layer.
type.ToString();
203 foreach (
Blob<T> b
in colBottom)
213 foreach (
Blob<T> b
in layer.blobs)
218 foreach (
Blob<T> b
in layer.internal_blobs)
229 get {
return m_strName; }
237 get {
return m_strType; }
245 get {
return m_dfForwardTiming; }
253 get {
return m_dfForwardTimingAve; }
261 get {
return m_dfBackwardTiming; }
269 get {
return m_dfBackwardTimingAve; }
277 get {
return m_rgBlobInfo; }
289 if (blob.
Name == strBlob)
303 if (dbg.
Name != m_strName)
306 if (dbg.
Type != m_strType)
309 if (dbg.m_rgBlobInfo.Count != m_rgBlobInfo.Count)
312 for (
int i = 0; i < m_rgBlobInfo.Count; i++)
314 if (!dbg.m_rgBlobInfo[i].Compare(m_rgBlobInfo[i]))
328 for (
int i = 0; i < m_rgBlobInfo.Count; i++)
333 if (strBlobNan !=
null)
349 for (
int i=m_rgBlobInfo.Count-1; i>=0; i--)
354 if (strBlobNan !=
null)
369 return m_strName +
" (" + m_strType +
")";
387 double m_dfDataNanCount = 0;
388 double m_dfDataInfCount = 0;
389 double m_dfDiffNanCount = 0;
390 double m_dfDiffInfCount = 0;
445 Tuple<double, double, double, double> data = b.
minmax_data(work, bDetectNans);
446 Tuple<double, double, double, double> diff = b.
minmax_diff(work, bDetectNans);
448 m_dfDataMin = data.Item1;
449 m_dfDataMax = data.Item2;
450 m_dfDataNanCount = data.Item3;
451 m_dfDataInfCount = data.Item4;
452 m_dfDiffMin = diff.Item1;
453 m_dfDiffMax = diff.Item2;
454 m_dfDiffNanCount = diff.Item3;
455 m_dfDiffInfCount = diff.Item4;
463 get {
return m_strName; }
471 get {
return m_strSize; }
485 return double.PositiveInfinity;
502 return double.PositiveInfinity;
513 get {
return m_dfDataNanCount; }
521 get {
return m_dfDataInfCount; }
535 return double.PositiveInfinity;
552 return double.PositiveInfinity;
563 get {
return m_dfDiffNanCount; }
571 get {
return m_dfDiffInfCount; }
579 get {
return m_type; }
587 get {
return m_location; }
597 if (dbg.
Name != m_strName)
600 if (dbg.
Size != m_strSize)
643 if (!isValid(m_dfDataMin))
645 strType =
"data min";
649 if (!isValid(m_dfDataMax))
651 strType =
"data max";
655 if (m_dfDataNanCount > 0)
657 strType =
"data nan";
661 if (m_dfDataInfCount > 0)
663 strType =
"data inf";
667 if (!isValid(m_dfDiffMin))
669 strType =
"diff min";
673 if (!isValid(m_dfDiffMax))
675 strType =
"diff max";
679 if (m_dfDiffNanCount > 0)
681 strType =
"diff nan";
685 if (m_dfDiffInfCount > 0)
687 strType =
"diff inf";
702 if (!isValid(m_dfDiffMin))
704 strType =
"diff min";
708 if (!isValid(m_dfDiffMax))
710 strType =
"diff max";
714 if (m_dfDiffNanCount > 0)
716 strType =
"diff nan";
720 if (m_dfDiffInfCount > 0)
722 strType =
"diff inf";
726 if (!isValid(m_dfDataMin))
728 strType =
"data min";
732 if (!isValid(m_dfDataMax))
734 strType =
"data max";
738 if (m_dfDataNanCount > 0)
740 strType =
"data nan";
744 if (m_dfDataInfCount > 0)
746 strType =
"data inf";
754 private bool isValid(
double df)
756 if (
double.IsNaN(df))
759 if (
double.IsInfinity(df))
771 return m_strName +
" (" + m_strSize +
")";
The BlobCollection contains a list of Blobs.
The Blob is the main holder of data that moves through the Layers of the Net.
Tuple< double, double, double, double > minmax_data(Blob< T > work, bool bDetectNans=false, bool bUseChunks=false)
Returns the minimum and maximum values in the data of the Blob.
Tuple< double, double, double, double > minmax_diff(Blob< T > work, bool bDetectNans=false, bool bUseChunks=false)
Returns the minimum and maximum values in the diff of the Blob.
string Name
Get/set the name of the Blob.
virtual void Dispose(bool bDisposing)
Releases all resources used by the Blob (including both GPU and Host).
string ToSizeString()
Returns a string describing the 4D shape of the Blob.
An interface for the units of computation which can be composed into a Net.
double backward_timing
Returns the timing of the last backward pass in milliseconds.
double backward_timing_average
Returns the average timing of the backward passes in milliseconds.
double forward_timing_average
Returns the average timing of the forward passes in milliseconds.
LayerParameter.LayerType type
Returns the LayerType of this Layer.
double forward_timing
Returns the timing of the last forward pass in milliseconds.
LayerParameter layer_param
Returns the LayerParameter for this Layer.
The MyCaffe.common namespace contains common MyCaffe classes.
@ INTERNAL
The blob is an internal blob used within the layer.
The MyCaffe.layers namespace contains all layers that have a solidified code base,...
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...