3using System.Collections.Generic;
7using System.Threading.Tasks;
19 bool m_bPreLoaded =
false;
20 bool m_bSaveOnCleanup =
false;
21 double[] m_rgWts =
null;
36 m_bPreLoaded = bPreLoad;
37 m_bSaveOnCleanup = bSaveOnCleanup;
40 m_mem.
Load(m_strFile);
49 m_mem.
Save(m_strFile);
57 get {
return m_mem.
Count; }
79 if (m_rgWts ==
null || m_rgWts.Length != nCount)
81 m_rgWts =
new double[nCount];
82 for (
int i = 0; i < m_rgWts.Length; i++)
88 if (m_rgIdx ==
null || m_rgIdx.Length != nCount)
90 m_rgIdx =
new int[nCount];
97 for (
int i = 0; i < nCount; i++)
99 mem.
Add(m_mem[m_nSampleIdx]);
102 if (m_nSampleIdx == m_mem.
Count)
The CryptoRandom is a random number generator that can use either the standard .Net Random objec or t...
The FileMemoryCollection is used during debugging to load from and save to file.
void Update(MemoryCollection rgSamples)
Update - does nothing.
FileMemoryCollection(int nMax, bool bPreLoad, bool bSaveOnCleanup, string strFile)
The constructor.
void CleanUp()
Complete any final processing.
MemoryCollection GetSamples(CryptoRandom random, int nCount, double dfBeta)
Return a batch of items.
void Add(MemoryItem mi)
Add a new item to the collection.
int Count
Returns the number of items in the collection.
The memory collection stores a set of memory items.
void Load(string strFile)
Load all memory items from file.
MemoryCollection GetRandomSamples(CryptoRandom random, int nCount)
Retrieves a random sample of items from the list.
double[] Priorities
Get/set the priorities associated with the collection (if any).
int Count
Returns the current count of items.
int[] Indexes
Get/set the indexes associated with the collection (if any).
void Save(string strFile)
Save the memory items to file.
virtual void Add(MemoryItem item)
Adds a new memory item to the array of items and if at capacity, removes an item.
The MemoryItem stores the information about a given cycle.
The IMemoryCollection interface is implemented by all memory collection types.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...