MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.trainers.common.MemoryCollection Class Reference

The memory collection stores a set of memory items. More...

Public Member Functions

 MemoryCollection (int nMax)
 The constructor. More...
 
virtual void Add (MemoryItem item)
 Adds a new memory item to the array of items and if at capacity, removes an item. More...
 
MemoryCollection GetRandomSamples (CryptoRandom random, int nCount)
 Retrieves a random sample of items from the list. More...
 
List< StateBaseGetNextState ()
 Returns the list of Next State items. More...
 
List< SimpleDatumGetNextStateData ()
 Returns the list of data items associated with the next state. More...
 
List< SimpleDatumGetNextStateClip ()
 Returns the list of clip items associated with the next state. More...
 
List< SimpleDatumGetCurrentStateData ()
 Returns the list of data items associated with the current state. More...
 
List< SimpleDatumGetCurrentStateClip ()
 Returns the list of clip items associated with the current state. More...
 
float[] GetActionsAsOneHotVector (int nActionCount)
 Returns the action items as a set of one-hot vectors. More...
 
float[] GetInvertedDoneAsOneHotVector ()
 Returns the inverted done (1 - done) values as a one-hot vector. More...
 
float[] GetRewards ()
 Returns the rewards as a vector. More...
 
void Save (string strFile)
 Save the memory items to file. More...
 
void Load (string strFile)
 Load all memory items from file. More...
 

Protected Attributes

MemoryItem[] m_rgItems
 Specifies the memory item list. More...
 
int m_nNextIdx = 0
 Specifies the next available index in the rolling list. More...
 

Properties

int[] Indexes [getset]
 Get/set the indexes associated with the collection (if any). More...
 
double[] Priorities [getset]
 Get/set the priorities associated with the collection (if any). More...
 
int NextIndex [get]
 Returns the next index. More...
 
int Count [get]
 Returns the current count of items. More...
 
MemoryItem this[int nIdx] [get]
 Get/set the memory item at a given index. More...
 

Detailed Description

The memory collection stores a set of memory items.

Definition at line 14 of file MemoryCollection.cs.

Constructor & Destructor Documentation

◆ MemoryCollection()

MyCaffe.trainers.common.MemoryCollection.MemoryCollection ( int  nMax)

The constructor.

Parameters
nMaxSpecifies the maximum number of items to store.

Definition at line 32 of file MemoryCollection.cs.

Member Function Documentation

◆ Add()

virtual void MyCaffe.trainers.common.MemoryCollection.Add ( MemoryItem  item)
virtual

Adds a new memory item to the array of items and if at capacity, removes an item.

Parameters
itemSpecifies the memory item to add.

Definition at line 85 of file MemoryCollection.cs.

◆ GetActionsAsOneHotVector()

float[] MyCaffe.trainers.common.MemoryCollection.GetActionsAsOneHotVector ( int  nActionCount)

Returns the action items as a set of one-hot vectors.

Parameters
nActionCountSpecifies the action count.
Returns
The one-hot vectors are returned as an array.

Definition at line 175 of file MemoryCollection.cs.

◆ GetCurrentStateClip()

List< SimpleDatum > MyCaffe.trainers.common.MemoryCollection.GetCurrentStateClip ( )

Returns the list of clip items associated with the current state.

Returns
The data items are returned.

Definition at line 162 of file MemoryCollection.cs.

◆ GetCurrentStateData()

List< SimpleDatum > MyCaffe.trainers.common.MemoryCollection.GetCurrentStateData ( )

Returns the list of data items associated with the current state.

Returns
The data items are returned.

Definition at line 153 of file MemoryCollection.cs.

◆ GetInvertedDoneAsOneHotVector()

float[] MyCaffe.trainers.common.MemoryCollection.GetInvertedDoneAsOneHotVector ( )

Returns the inverted done (1 - done) values as a one-hot vector.

Returns
The one-hot vectors are returned as an array.

Definition at line 196 of file MemoryCollection.cs.

◆ GetNextState()

List< StateBase > MyCaffe.trainers.common.MemoryCollection.GetNextState ( )

Returns the list of Next State items.

Returns
The state items are returned.

Definition at line 123 of file MemoryCollection.cs.

◆ GetNextStateClip()

List< SimpleDatum > MyCaffe.trainers.common.MemoryCollection.GetNextStateClip ( )

Returns the list of clip items associated with the next state.

Returns
The data items are returned.

Definition at line 141 of file MemoryCollection.cs.

◆ GetNextStateData()

List< SimpleDatum > MyCaffe.trainers.common.MemoryCollection.GetNextStateData ( )

Returns the list of data items associated with the next state.

Returns
The data items are returned.

Definition at line 132 of file MemoryCollection.cs.

◆ GetRandomSamples()

MemoryCollection MyCaffe.trainers.common.MemoryCollection.GetRandomSamples ( CryptoRandom  random,
int  nCount 
)

Retrieves a random sample of items from the list.

Parameters
randomSpecifies the random number generator to use.
nCountSpecifies the number of items to retrieve.
Returns
The sampled items are returned in a new MemoryCollection.

Definition at line 103 of file MemoryCollection.cs.

◆ GetRewards()

float[] MyCaffe.trainers.common.MemoryCollection.GetRewards ( )

Returns the rewards as a vector.

Returns
The rewards are returned as an array.

Definition at line 215 of file MemoryCollection.cs.

◆ Load()

void MyCaffe.trainers.common.MemoryCollection.Load ( string  strFile)

Load all memory items from file.

Parameters
strFileSpecifies the file containing the memory items.

Definition at line 244 of file MemoryCollection.cs.

◆ Save()

void MyCaffe.trainers.common.MemoryCollection.Save ( string  strFile)

Save the memory items to file.

Parameters
strFileSpecifies the file name.

Definition at line 224 of file MemoryCollection.cs.

Member Data Documentation

◆ m_nNextIdx

int MyCaffe.trainers.common.MemoryCollection.m_nNextIdx = 0
protected

Specifies the next available index in the rolling list.

Definition at line 26 of file MemoryCollection.cs.

◆ m_rgItems

MemoryItem [] MyCaffe.trainers.common.MemoryCollection.m_rgItems
protected

Specifies the memory item list.

Definition at line 22 of file MemoryCollection.cs.

Property Documentation

◆ Count

int MyCaffe.trainers.common.MemoryCollection.Count
get

Returns the current count of items.

Definition at line 66 of file MemoryCollection.cs.

◆ Indexes

int [] MyCaffe.trainers.common.MemoryCollection.Indexes
getset

Get/set the indexes associated with the collection (if any).

Definition at line 40 of file MemoryCollection.cs.

◆ NextIndex

int MyCaffe.trainers.common.MemoryCollection.NextIndex
get

Returns the next index.

Definition at line 58 of file MemoryCollection.cs.

◆ Priorities

double [] MyCaffe.trainers.common.MemoryCollection.Priorities
getset

Get/set the priorities associated with the collection (if any).

Definition at line 49 of file MemoryCollection.cs.

◆ this[int nIdx]

MemoryItem MyCaffe.trainers.common.MemoryCollection.this[int nIdx]
get

Get/set the memory item at a given index.

Parameters
nIdxSpecifies the index of the item to access.
Returns
Returns the memory item at an index.

Definition at line 76 of file MemoryCollection.cs.


The documentation for this class was generated from the following file: