4using System.Collections.Generic;
8using System.Threading.Tasks;
22 Dictionary<int, TemporalSet> m_rgTemporalSets =
new Dictionary<int, TemporalSet>();
23 Dictionary<Phase, TemporalSet> m_rgTemporalSetsEx =
new Dictionary<Phase, TemporalSet>();
41 foreach (KeyValuePair<int, TemporalSet> kv
in m_rgTemporalSets)
47 m_rgTemporalSets.Clear();
48 m_rgTemporalSetsEx.Clear();
66 if (m_rgTemporalSetsEx.ContainsKey(phase))
67 return m_rgTemporalSetsEx[phase];
79 if (m_rgTemporalSets.ContainsKey(nSourceID))
80 return m_rgTemporalSets[nSourceID];
95 if (m_rgTemporalSetsEx.ContainsKey(
Phase.TRAIN))
96 dfTraining = m_rgTemporalSetsEx[
Phase.TRAIN].LoadPercent;
100 if (m_rgTemporalSetsEx.ContainsKey(
Phase.TEST))
101 dfTesting = m_rgTemporalSetsEx[
Phase.TEST].LoadPercent;
103 return (dfTraining + dfTesting) / 2.0;
118 public bool Load(
DB_LOAD_METHOD loadMethod,
int nLoadLimit,
double dfReplacementPct,
int nRefreshUpdateMs,
bool bNormalizedData,
int nHistoricalSteps,
int nFutureSteps,
int nChunks, EventWaitHandle evtCancel)
120 List<TemporalSet> rgInit =
new List<TemporalSet>();
124 TemporalSet ts =
new TemporalSet(m_log, m_db, m_ds.
TrainingSource, loadMethod, nLoadLimit, dfReplacementPct, nRefreshUpdateMs, m_random, nHistoricalSteps, nFutureSteps, nChunks);
126 m_rgTemporalSetsEx.Add(
Phase.TRAIN, ts);
132 TemporalSet ts =
new TemporalSet(m_log, m_db, m_ds.
TestingSource, loadMethod, nLoadLimit, dfReplacementPct, nRefreshUpdateMs, m_random, nHistoricalSteps, nFutureSteps, nChunks);
134 m_rgTemporalSetsEx.Add(
Phase.TEST, ts);
140 if (!ts1.
Initialize(bNormalizedData, evtCancel))
154 foreach (KeyValuePair<int, TemporalSet> kv
in m_rgTemporalSets)
156 if (!kv.Value.WaitForLoadingToComplete(evtCancel))
The CryptoRandom is a random number generator that can use either the standard .Net Random objec or t...
The Log class provides general output in text form.
int ID
Get/set the database ID of the item.
The DatasetDescriptor class describes a dataset which contains both a training data source and testin...
SourceDescriptor TrainingSource
Get/set the training data source.
SourceDescriptor TestingSource
Get/set the testing data source.
The DataSet class loads the training and testing data.
void CleanUp()
Remove all data for the dataset from memory.
DatasetDescriptor Dataset
Return the dataset descriptor.
DataSet(DatasetDescriptor ds, Log log)
The constructor.
double GetLoadPercent(out double dfTraining, out double dfTesting)
Return the load percentage for the dataset.
bool WaitForLoadingToComplete(AutoResetEvent evtCancel)
Wait for the loading to complete.
TemporalSet GetTemporalSetBySourceID(int nSourceID)
Returns the temporal set for the specified source ID.
TemporalSet GetTemporalSetByPhase(Phase phase)
Returns the temporal set for the specified phase.
bool Load(DB_LOAD_METHOD loadMethod, int nLoadLimit, double dfReplacementPct, int nRefreshUpdateMs, bool bNormalizedData, int nHistoricalSteps, int nFutureSteps, int nChunks, EventWaitHandle evtCancel)
Load the training and testing data.
The DatabaseTemporal is used to manage all temporal specific database objects.
The TemporalSet manages a set of temporal data for a given data source.
bool Initialize(bool bNormalizedData, EventWaitHandle evtCancel)
Load the data based on the data load method.
The descriptors namespace contains all descriptor used to describe various items stored within the da...
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
DB_LOAD_METHOD
Defines how to laod the items into the in-memory database.
Phase
Defines the Phase under which to run a Net.
The MyCaffe.db.temporal namespace contains all classes used to create the MyCaffeTemporalDatabase in-...
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...