MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.db.image.QueryState Class Reference

Initially the QueryState is copied from the MasterIndexes and during each query is altered by removing items already observed. Once empty, each Index within the QueryState is then refreshed with the corresponding MasterIndexes ensuring that all images are hit over time. More...

Inheritance diagram for MyCaffe.db.image.QueryState:
MyCaffe.db.image.MasterIndexes

Public Member Functions

 QueryState (MasterIndexes master, bool bUseUniqueLabelIndexes=true, bool bUseUniqueImageIndexes=true, IMGDB_SORT sort=IMGDB_SORT.BYIDX)
 The constructor. More...
 
void UpdateStats (SimpleDatum sd)
 Update the label stats. More...
 
int? GetNextLabel (DB_LABEL_SELECTION_METHOD lblSel)
 Returns the next label in the Index set selected based on the selection criteria. More...
 
override? int GetNextLabel (Index.SELECTION_TYPE type, bool bBoosted=false)
 Returns the next label in the Index set selected based on the selection criteria. More...
 
int? GetNextImage (DB_ITEM_SELECTION_METHOD imgSel, int? nLabel, int nDirectIdx)
 Returns the next image in the Index set based on the selection criteria. More...
 
override? int GetNextImage (Index.SELECTION_TYPE type, int? nLabel=null, bool bBoosted=false, int nDirectIdx=-1)
 Returns the next image in the Index set based on the selection criteria. More...
 
Dictionary< int, ulong > GetQueryLabelCounts ()
 Returns the query label counts. More...
 
string GetQueryBoostHitPercentsAsText ()
 Returns the number of times each boosted image vs. non boosted images are hit. More...
 
string GetQueryLabelHitPercentsAsText ()
 Returns the number of times each label is hit. More...
 
string GetQueryLabelEpochsAsText ()
 Returns the number of epochs each label has experienced. More...
 
- Public Member Functions inherited from MyCaffe.db.image.MasterIndexes
 MasterIndexes (CryptoRandom random, SourceDescriptor src, int nLoadLimit=0)
 The constructor. More...
 
 MasterIndexes (MasterIndexes idx, IMGDB_SORT sort)
 The constructor used to copy another MasterIndexes and optionally specify a sorting for the indexes. More...
 
void Dispose ()
 Release all resources used. More...
 
List< DbItemFindImageIndexes (DateTime dt)
 Returns all DbItems that point to images iwth a given date. More...
 
void Reload (List< DbItem > rgItems)
 Reload all images by re-loading the master index list. More...
 
Index GetIndex (int? nLabel=null, bool bBoosted=false)
 Returns the Index matching the criteria. More...
 
void SetIndex (Index idx, int? nLabel=null, bool bBoosted=false)
 Set a given index based on the criteria. More...
 
List< int > GetIndexes (int nStartIdx, int nQueryCount=int.MaxValue, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
 Returns the indexes fitting the criteria. More...
 
List< int > GetIndexes (DateTime dtStart, int nQueryCount=int.MaxValue, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
 Returns the indexes fitting the criteria. More...
 
override string ToString ()
 Returns a string representation of the master indexes. More...
 

Additional Inherited Members

- Protected Attributes inherited from MyCaffe.db.image.MasterIndexes
SourceDescriptor m_src
 Specifies the data source descriptor. More...
 
Index m_index = null
 Specifies the index into all of the data source images. More...
 
LabelIndex m_rgLabels = null
 Specifies the list of images listed by label where each label contains an index into all images with that label. More...
 
Index m_boosted = null
 Specifies the list of all boosted images. More...
 
LabelIndex m_rgLabelsBoosted = null
 Specifies the list of all boosted images listed by label where each label contains an index into all boosted images with that label. More...
 
- Properties inherited from MyCaffe.db.image.MasterIndexes
List< DbItemRawIndexes [get]
 Returns the raw indexes. More...
 
int LoadLimit [get]
 Returns the load limit set during initialization. More...
 
int LabelCount [get]
 Returns the number of labels. More...
 

Detailed Description

Initially the QueryState is copied from the MasterIndexes and during each query is altered by removing items already observed. Once empty, each Index within the QueryState is then refreshed with the corresponding MasterIndexes ensuring that all images are hit over time.

QueryStates may also be ordered which is usedful in SEQUENTIAL querries.

Definition at line 18 of file QueryState.cs.

Constructor & Destructor Documentation

◆ QueryState()

MyCaffe.db.image.QueryState.QueryState ( MasterIndexes  master,
bool  bUseUniqueLabelIndexes = true,
bool  bUseUniqueImageIndexes = true,
IMGDB_SORT  sort = IMGDB_SORT.BYIDX 
)

The constructor.

Parameters
masterSpecifies the MasterIndexes to copy.
bUseUniqueLabelIndexesOptionally, specifies to use unique label indexes which is slightly slower, but ensures each label is hit per epoch equally (default = true).
bUseUniqueImageIndexesOptionally, specifies to use unique image indexes which is slightly slower, but ensures each image is hit per epoch (default = true).
sortOptionally, specifies the ordering to use on the indexes (default = BYIDX).

Definition at line 32 of file QueryState.cs.

Member Function Documentation

◆ GetNextImage() [1/2]

int? MyCaffe.db.image.QueryState.GetNextImage ( DB_ITEM_SELECTION_METHOD  imgSel,
int?  nLabel,
int  nDirectIdx 
)

Returns the next image in the Index set based on the selection criteria.

Parameters
imgSelSpecifies the image selection method used.
nLabelOptionally, specifies a label (default = null).
nDirectIdxOptionally, specifies to query the image at this index (only applies when type = DIRECT).
Returns

Definition at line 100 of file QueryState.cs.

◆ GetNextImage() [2/2]

override? int MyCaffe.db.image.QueryState.GetNextImage ( Index.SELECTION_TYPE  type,
int?  nLabel = null,
bool  bBoosted = false,
int  nDirectIdx = -1 
)
virtual

Returns the next image in the Index set based on the selection criteria.

Parameters
typeSpecifies the selection type (e.g. RANDOM, SEQUENTIAL).
nLabelOptionally, specifies a label (default = null).
bBoostedOptionally, specifies to query boosted images (default = false).
nDirectIdxOptionally, specifies to query the image at this index (only applies when type = DIRECT).
Returns
The next image index is returned.

Reimplemented from MyCaffe.db.image.MasterIndexes.

Definition at line 131 of file QueryState.cs.

◆ GetNextLabel() [1/2]

int? MyCaffe.db.image.QueryState.GetNextLabel ( DB_LABEL_SELECTION_METHOD  lblSel)

Returns the next label in the Index set selected based on the selection criteria.

Parameters
lblSelSpecifies the label selection method used.
Returns
The next label index is returned.

Definition at line 60 of file QueryState.cs.

◆ GetNextLabel() [2/2]

override? int MyCaffe.db.image.QueryState.GetNextLabel ( Index.SELECTION_TYPE  type,
bool  bBoosted = false 
)
virtual

Returns the next label in the Index set selected based on the selection criteria.

Parameters
typeSpecifies the selection type (e.g. RANDOM, SEQUENTIAL).
bBoostedOptionally, specifies to use label sets of boosted images (default = false).
Returns
The next label index is returned.

Reimplemented from MyCaffe.db.image.MasterIndexes.

Definition at line 80 of file QueryState.cs.

◆ GetQueryBoostHitPercentsAsText()

string MyCaffe.db.image.QueryState.GetQueryBoostHitPercentsAsText ( )

Returns the number of times each boosted image vs. non boosted images are hit.

Returns
The percentage of non-boosted vs. boosted images is returned as {non-boosted%, boosted%}.

Definition at line 184 of file QueryState.cs.

◆ GetQueryLabelCounts()

Dictionary< int, ulong > MyCaffe.db.image.QueryState.GetQueryLabelCounts ( )

Returns the query label counts.

Returns
The query label counts are returned.

Definition at line 175 of file QueryState.cs.

◆ GetQueryLabelEpochsAsText()

string MyCaffe.db.image.QueryState.GetQueryLabelEpochsAsText ( )

Returns the number of epochs each label has experienced.

Returns

Definition at line 202 of file QueryState.cs.

◆ GetQueryLabelHitPercentsAsText()

string MyCaffe.db.image.QueryState.GetQueryLabelHitPercentsAsText ( )

Returns the number of times each label is hit.

Returns
The percentage of times each label hit occurs is returned in label order (e.g. label 0%, label 1%,... label n%).

Definition at line 193 of file QueryState.cs.

◆ UpdateStats()

void MyCaffe.db.image.QueryState.UpdateStats ( SimpleDatum  sd)

Update the label stats.

Parameters
sdSpecifies the recently queried simple datum.

Definition at line 49 of file QueryState.cs.


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