2using System.Collections.Generic;
18 ulong m_lWorkspaceSize = 0;
19 long m_hWorkspaceData = 0;
28 m_hWorkspaceData = hData;
29 m_lWorkspaceSize = lSize;
37 get {
return m_hWorkspaceData; }
38 set { m_hWorkspaceData = value; }
46 get {
return m_lWorkspaceSize; }
47 set { m_lWorkspaceSize = value; }
72 get {
return m_blobBaseWork; }
73 set { m_blobBaseWork = value; }
81 get {
return m_blobHalfWork; }
82 set { m_blobHalfWork = value; }
106 get {
return m_work; }
107 set { m_work = value; }
119 bool m_bAccuracyValid =
false;
136 get {
return m_results; }
144 get {
return m_dfAccuracy; }
147 m_dfAccuracy = value;
148 m_bAccuracyValid =
true;
157 get {
return m_bAccuracyValid; }
158 set { m_bAccuracyValid = value; }
170 int m_nIterationOverride = -1;
171 int m_nTestNetID = 0;
172 double m_dfAccuracy = 0;
179 public TestArgs(
int nIterationOverride,
int nTestNetID)
181 m_nIterationOverride = nIterationOverride;
182 m_nTestNetID = nTestNetID;
190 get {
return m_nIterationOverride; }
198 get {
return m_nTestNetID; }
206 get {
return m_dfAccuracy; }
207 set { m_dfAccuracy = value; }
219 double m_dfMsTiming = 0;
229 m_dfAccuracy = dfAccuracy;
230 m_nIteration = nIteration;
231 m_dfMsTiming = dfMsTiming;
239 get {
return m_dfAccuracy; }
247 get {
return m_nIteration; }
255 get {
return m_dfMsTiming; }
266 double m_dfSmoothedLoss;
267 double m_dfBestSmoothedLoss;
268 bool m_bWeightsUpdated =
false;
269 string m_strActiveLabelCounts =
"";
270 string m_strLabelQueryHitPercents =
"";
271 string m_strLabelQueryEpochs =
"";
272 string m_strBoostQueryHitPercents =
"";
273 double m_dfLearningRate = 0;
292 public TrainingIterationArgs(
int nIteration,
double dfAccuracy,
double dfLoss,
double dfSmoothedLoss,
double dfBestSmoothedLoss,
bool bWeightsUpdated,
string strActiveLabelCounts,
string strLabelQueryHitPercents,
string strLabelQueryEpochs,
string strBoostQueryHitPercents,
double dfLearningRate,
double dfMsTiming,
DebugInformation<T> dbgInfo =
null)
293 : base(nIteration, dfAccuracy, dfMsTiming)
296 m_dfSmoothedLoss = dfSmoothedLoss;
297 m_dfBestSmoothedLoss = dfBestSmoothedLoss;
298 m_bWeightsUpdated = bWeightsUpdated;
299 m_strActiveLabelCounts = strActiveLabelCounts;
300 m_strLabelQueryHitPercents = strLabelQueryHitPercents;
301 m_strLabelQueryEpochs = strLabelQueryEpochs;
302 m_strBoostQueryHitPercents = strBoostQueryHitPercents;
303 m_dfLearningRate = dfLearningRate;
312 get {
return m_dfLoss; }
320 get {
return m_dfSmoothedLoss; }
328 get {
return m_dfBestSmoothedLoss; }
336 get {
return m_bWeightsUpdated; }
344 get {
return m_strActiveLabelCounts; }
352 get {
return m_strLabelQueryHitPercents; }
360 get {
return m_strLabelQueryEpochs; }
368 get {
return m_strBoostQueryHitPercents; }
376 get {
return m_dfLearningRate; }
384 get {
return m_dbgInfo; }
393 byte[] m_rgBytes =
null;
407 get {
return m_rgBytes; }
408 set { m_rgBytes = value; }
417 byte[] m_rgWeights =
null;
418 byte[] m_rgState =
null;
419 double m_dfAccuracy = 0;
420 double m_dfError = 0;
421 int m_nIteration = 0;
423 bool m_bIncludeWeights =
true;
424 bool m_bIncludeState =
false;
425 bool m_bSingleStep =
false;
426 bool m_bForced =
false;
427 bool m_bScheduled =
true;
428 bool m_bUpdateDatabase =
true;
458 m_rgWeights = rgWeights;
459 m_dfAccuracy = dfAccuracy;
461 m_nIteration = nIteration;
475 m_rgState = args.
Data;
492 m_rgWeights = args.
Data;
504 get {
return m_rgState; }
505 set { m_rgState = value; }
513 get {
return m_rgWeights; }
514 set { m_rgWeights = value; }
522 get {
return m_dfAccuracy; }
530 get {
return m_dfError; }
538 get {
return m_nIteration; }
546 get {
return m_favor; }
554 get {
return m_bIncludeWeights; }
555 set { m_bIncludeWeights = value; }
563 get {
return m_bIncludeState; }
564 set { m_bIncludeState = value; }
572 get {
return m_bSingleStep; }
573 set { m_bSingleStep = value; }
581 get {
return m_bForced; }
582 set { m_bForced = value; }
590 get {
return m_bScheduled; }
591 set { m_bScheduled = value; }
599 get {
return m_bUpdateDatabase; }
600 set { m_bUpdateDatabase = value; }
612 bool m_bFwdPassNanFree =
true;
613 double m_dfLocalLoss = 0;
631 get {
return m_net; }
639 get {
return m_step; }
647 get {
return m_bFwdPassNanFree; }
648 set { m_bFwdPassNanFree = value; }
656 get {
return m_dfLocalLoss; }
657 set { m_dfLocalLoss = value; }
678 m_colBottom = colBottom;
686 get {
return m_colBottom; }
694 get {
return m_colTop; }
704 List<bool> m_rgbPropagateDown;
713 : base(colBottom, colTop)
715 m_rgbPropagateDown = rgbPropagateDown;
723 get {
return m_rgbPropagateDown; }
749 int m_nIteration = 0;
767 m_nIteration = nIteration;
775 get {
return m_nIteration; }
783 get {
return m_phase; }
The BackwardArgs are passed to the OnBackward event of the EventLayer.
BackwardArgs(BlobCollection< T > colTop, List< bool > rgbPropagateDown, BlobCollection< T > colBottom)
The constructor.
List< bool > PropagateDown
Returns the list on whether or not to propagate down.
The BlobCollection contains a list of Blobs.
The Blob is the main holder of data that moves through the Layers of the Net.
The CustomForwardBackArgs provide the arguments to the OnCustomForwardBack event within the Solver St...
double LocalLoss
Get/set the local loss of the pass.
TRAIN_STEP step
Returns whether or not to step the operation.
Net< T > net
Returns the training network.
bool FwdPassNanFree
Get/set whether or a NAN was detected in the forward pass.
CustomForwardBackArgs(Net< T > net, TRAIN_STEP step)
The constructor.
The ForwardArgs are passed to the OnForward event of the EventLayer.
BlobCollection< T > BottomVec
Returns the bottom blobs.
ForwardArgs(BlobCollection< T > colBottom, BlobCollection< T > colTop)
The constructor.
BlobCollection< T > TopVec
Returns the top blobs.
The GetBytesArgs is passed along to the SnapshotArgs::OnGetWeights and SnapshotArgs::OnGetState event...
byte[] Data
Get/set the data as an array of bytes.
GetBytesArgs()
The GetBytesArgs constructor.
The GetConversionBlobArgs are passed to the Layer::OnGetConversionBlobs event which fires each time a...
GetConversionBlobArgs()
The constructor.
Blob< T > BaseWork
The work blob in the base size.
Blob< T > HalfWork
The work blob in the half size.
The GetIterationArgs is sent bubbled up to the solver when a layer needs to know the curret training ...
GetIterationArgs()
The constructor.
int Iteration
Returns the iteration.
Phase CurrentPhase
Returns the phase.
void SetIteration(Phase p, int nIteration)
The SetIteration method is used to set the iteration and the phase.
The GetWorkBlobArgs are passed to the Layer::OnGetWorkBlob event which is supported for debugging onl...
GetWorkBlobArgs()
The constructor.
The GradientsReadyArgs is sent to the Solver::OnGradientsReady event which fires at the end of each S...
GradientsReadyArgs()
The GradientReadyArgs constructor.
Connects Layer's together into a direct acrylic graph (DAG) specified by a NetParameter
The SnapshotArgs is sent to the Solver::OnSnapshot event which fires each time the Solver::Snapshot m...
byte[] UpdateWeights()
Retrieves the updated training Net weights as an array of bytes.
int Iteration
Returns the current iteration of the current training session.
bool Forced
Get/set whether or not the snapshot was forced or not.
byte[] UpdateState()
Retrieves the updated Solver state as an array of bytes.
bool SingleStep
Get/set the Solver single step.
bool IncludeWeights
Get/set whether or not to include the weights in the snapshot.
bool Scheduled
Get/set whether or not the snapshot is a regular scheduled snapshot (e.g. not an improved accuracy or...
bool IncludeState
Get/set whether or not to include the Solver state in the snapshot.
byte[] State
Get/set the Solver State.
SnapshotArgs(byte[] rgState, byte[] rgWeights, double dfAccuracy, double dfError, int nIteration, SNAPSHOT_WEIGHT_UPDATE_METHOD favor)
The SnapshotArgs constructor.
byte[] Weights
Get/set the Weights.
EventHandler< GetBytesArgs > OnGetState
Specifies the OnGetState event which fires when the SnapshotArgs::UpdateState method is called.
double Accuracy
Returns the last observed Solver accuracy for the current training session.
bool UpdateDatabase
Get/set whether or not to update the database (default = true).
SNAPSHOT_WEIGHT_UPDATE_METHOD Favor
Specifies whether to favor the error, the accuracy or both when deciding whether a snapshot should ta...
EventHandler< GetBytesArgs > OnGetWeights
Specifies the OnGetWeights event which fires when the SnapshotArgs::UpdateWeights method is called.
double Error
Returns the last observed Solver error for the current training session.
The TestArgs are passed to the Solver::OnTest event.
TestArgs(int nIterationOverride, int nTestNetID)
The TestArgs constructor.
int IterationOverride
Returns the testing iteration override. When set to -1, the solver description test iteration is used...
double Accuracy
Get/set the accuracy for the test run. When overriding the testing, the override should set the accur...
int TestNetID
Returns the test Net identifier of the Solver test Net to run.
The TestResultArgs are passed to the Solver::OnTestResults event.
bool AccuracyValid
Get/set the accuracy valid flag. When not valid, the OnTestResults event is ignored.
BlobCollection< T > Results
Returns the results from the test.
TestResultArgs(BlobCollection< T > res)
The constructor.
double Accuracy
Get/set the accuracy. The recipient of this event should set this value.
Specifies the TestingIterationArgs sent to the Solver::OnTestingIteration, which is called at the end...
double Timing
Return the timing of the test cycle in ms.
double Accuracy
Return the accuracy of the test cycle.
int Iteration
Return the iteration of the test cycle.
TestingIterationArgs(int nIteration, double dfAccuracy, double dfMsTiming)
The TestingIterationArgs constructor.
The TrainingIterationArgs is sent to the Solver::OnTrainingIteration event that fires at the end of a...
string ActiveLabelCounts
Returns the current active label counts as a string.
double LearningRate
Return the current learning rate.
string LabelQueryEpochs
Returns the current label epochs per label observed at this point in training.
double BestSmoothedLoss
Returns the best smoothed loss observed during the training.
double Loss
Returns the loss of the training cycle.
double SmoothedLoss
Retunrs the average loss after the training cycle.
string LabelQueryHitPercents
Returns the current label query hit percentages observed at this point in training.
string BoostQueryHitPercents
Returns the current boost query hit percentages observed at this point in training.
bool WeightsUpdated
Returns whether or not the weights have been updated.
TrainingIterationArgs(int nIteration, double dfAccuracy, double dfLoss, double dfSmoothedLoss, double dfBestSmoothedLoss, bool bWeightsUpdated, string strActiveLabelCounts, string strLabelQueryHitPercents, string strLabelQueryEpochs, string strBoostQueryHitPercents, double dfLearningRate, double dfMsTiming, DebugInformation< T > dbgInfo=null)
The TrainingIterationArgs constructor.
The WorkspaceArgs are passed to both the Layer::OnSetWorkspace and Layer::OnGetWorkspace events.
long WorkspaceData
Get/set the handle to workspace data in GPU memory.
ulong WorkspaceSizeInBytes
Get/set the workspace memory size in bytes.
WorkspaceArgs(long hData, ulong lSize)
The WorkspaceArgs constructor.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
Phase
Defines the Phase under which to run a Net.
SNAPSHOT_WEIGHT_UPDATE_METHOD
Defines the snapshot weight update method.
The MyCaffe.common namespace contains common MyCaffe classes.
TRAIN_STEP
Defines the training stepping method (if any).
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-...