MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
The BucketCollection contains a set of Buckets. More...
Public Types | |
enum | OUTPUT_FMT { NONE , TXT , CSV } |
Specifies the output format used when creating a distribution string. More... | |
Public Member Functions | |
BucketCollection (double fMin, double fMax, int nCount) | |
The constructor. More... | |
BucketCollection (List< int > rgVocab) | |
The constructor. More... | |
BucketCollection (bool bIsReal) | |
The constructor. More... | |
Bucket | GetBucketWithMaxCount () |
Returns the bucket with the highest count. More... | |
Tuple< double, double > | GetRange () |
Returns the numeric range that all buckets fall into. More... | |
int | Add (double fVal) |
Finds the correct Bucket and adds the value to it. More... | |
void | Reduce (double dfPct) |
Reduces the buckets to only include those that have a count that are within 1.0 - dfPct of the maximum bucket count. More... | |
double | Translate (double fVal) |
Finds the Bucket associated with the value and returns the Bucket's average value. More... | |
int | FindIndex (double dfVal) |
Finds the index of the Bucket containing the value. More... | |
double | GetValueAt (int nIdx, bool bUseMidPoint=false) |
Returns the average of the Bucket at a given index. More... | |
bool | UnBucketize (string strName, List< double[]> rgrgData, Log log, CancelEvent evtCancel) |
The UnBucketize method converts all Data received into their respective Bucket average values. More... | |
byte[] | ToByteStream () |
Converts the BucketCollection into a byte stream. More... | |
string | ToDistributionString (OUTPUT_FMT fmt=OUTPUT_FMT.NONE, int nMaxDots=30, string strFmt="0.00000", bool bIncludePercents=false) |
Returns the distribution of buckets as a percentage for each time a bucket was hit. More... | |
IEnumerator< Bucket > | GetEnumerator () |
Returns the enumerator used in foreach loops. More... | |
Static Public Member Functions | |
static BucketCollection | Bucketize (string strName, int nBucketCount, SimpleDatum sd, Log log, CancelEvent evtCancel, double? dfMin=null, double? dfMax=null) |
The Bucketize method adds all values within a SimpleDatum to a new BucketCollection. More... | |
static BucketCollection | FromByteStream (byte[] rg) |
Converts a byte stream into a BucketCollection. More... | |
Properties | |
bool | IsDataReal [getset] |
Get/set whether or not the Buckets hold Real values. More... | |
int | Count [get] |
Returns the number of Buckets. More... | |
Bucket | this[int nIdx] [get] |
Returns the bucket at a given index. More... | |
int | TotalCount [get] |
Returns the total count across all buckets. More... | |
The BucketCollection contains a set of Buckets.
Definition at line 164 of file BucketCollection.cs.
Specifies the output format used when creating a distribution string.
Enumerator | |
---|---|
NONE | No special output formatting used. |
TXT | Format for a text file. |
CSV | Format for a CSV file. |
Definition at line 172 of file BucketCollection.cs.
MyCaffe.basecode.BucketCollection.BucketCollection | ( | double | fMin, |
double | fMax, | ||
int | nCount | ||
) |
The constructor.
fMin | Specifies the overall minimum of all Buckets. |
fMax | Specifies the overall maximum of all Buckets. |
nCount | Specifies the number of Buckets to use. |
Definition at line 194 of file BucketCollection.cs.
MyCaffe.basecode.BucketCollection.BucketCollection | ( | List< int > | rgVocab | ) |
The constructor.
rgVocab | Specifies an array of vocabulary values to add into Buckets. |
Definition at line 215 of file BucketCollection.cs.
MyCaffe.basecode.BucketCollection.BucketCollection | ( | bool | bIsReal | ) |
The constructor.
bIsReal | Specifies that the Buckets are to hold Real values. |
Definition at line 234 of file BucketCollection.cs.
int MyCaffe.basecode.BucketCollection.Add | ( | double | fVal | ) |
Finds the correct Bucket and adds the value to it.
fVal | Specifies the value to add. |
Definition at line 307 of file BucketCollection.cs.
|
static |
The Bucketize method adds all values within a SimpleDatum to a new BucketCollection.
strName | Specifies the name to use when writing status information. |
nBucketCount | Specifies the number of Buckets to use. |
sd | Specifies the SimpleDatum containing the data to add. |
log | Specifies the output log. |
evtCancel | Specifies the CancelEvent used to cancel the bucketizing process. |
dfMin | Optionally, specifies a overall minimum to use in the BucketCollection, when missing this is calculated from the SimpleDatum. |
dfMax | Optionally, specifies a overall maximum to use in the BucketCollection, when missing this is calculated from the SimpleDatum. |
Definition at line 407 of file BucketCollection.cs.
int MyCaffe.basecode.BucketCollection.FindIndex | ( | double | dfVal | ) |
Finds the index of the Bucket containing the value.
dfVal | Specifies the value to look for. |
Definition at line 371 of file BucketCollection.cs.
|
static |
Converts a byte stream into a BucketCollection.
rg | Specifies the byte stream. |
Definition at line 544 of file BucketCollection.cs.
Bucket MyCaffe.basecode.BucketCollection.GetBucketWithMaxCount | ( | ) |
Returns the bucket with the highest count.
Definition at line 270 of file BucketCollection.cs.
IEnumerator< Bucket > MyCaffe.basecode.BucketCollection.GetEnumerator | ( | ) |
Returns the enumerator used in foreach loops.
Definition at line 638 of file BucketCollection.cs.
Tuple< double, double > MyCaffe.basecode.BucketCollection.GetRange | ( | ) |
Returns the numeric range that all buckets fall into.
Definition at line 294 of file BucketCollection.cs.
double MyCaffe.basecode.BucketCollection.GetValueAt | ( | int | nIdx, |
bool | bUseMidPoint = false |
||
) |
Returns the average of the Bucket at a given index.
nIdx | Specifies the index. |
bUseMidPoint | Optionally specifies to use the bucket midpoint instead of the average. |
Definition at line 388 of file BucketCollection.cs.
void MyCaffe.basecode.BucketCollection.Reduce | ( | double | dfPct | ) |
Reduces the buckets to only include those that have a count that are within 1.0 - dfPct of the maximum bucket count.
dfPct | Specifies the threshold percent where all buckets with a count >= Max Count * (1.0 - dfPct) are kept. |
Definition at line 335 of file BucketCollection.cs.
byte[] MyCaffe.basecode.BucketCollection.ToByteStream | ( | ) |
Converts the BucketCollection into a byte stream.
Definition at line 522 of file BucketCollection.cs.
string MyCaffe.basecode.BucketCollection.ToDistributionString | ( | OUTPUT_FMT | fmt = OUTPUT_FMT.NONE , |
int | nMaxDots = 30 , |
||
string | strFmt = "0.00000" , |
||
bool | bIncludePercents = false |
||
) |
Returns the distribution of buckets as a percentage for each time a bucket was hit.
fmt | Optionally, specifies the output format of the string (default = NONE). |
nMaxDots | Optionally, specifies the maximum number of dots used when 'bFull' = true, ignored when 'bFull' = false (default = 30). |
strFmt | Optionally, specifies the format string for each range (default = '0.00000'). |
bIncludePercents | Optionally, specifies to include the percentages. |
Definition at line 589 of file BucketCollection.cs.
double MyCaffe.basecode.BucketCollection.Translate | ( | double | fVal | ) |
Finds the Bucket associated with the value and returns the Bucket's average value.
fVal | Specifies the value to find. |
Definition at line 355 of file BucketCollection.cs.
bool MyCaffe.basecode.BucketCollection.UnBucketize | ( | string | strName, |
List< double[]> | rgrgData, | ||
Log | log, | ||
CancelEvent | evtCancel | ||
) |
The UnBucketize method converts all Data received into their respective Bucket average values.
strName | Specifies the name to use when writing status information. |
rgrgData | Specifies the data to unbucketize. |
log | Specifies the output log. |
evtCancel | Specifies the CancelEvent used to cancel the unbucketizing process. |
Definition at line 485 of file BucketCollection.cs.
|
get |
Returns the number of Buckets.
Definition at line 251 of file BucketCollection.cs.
|
getset |
Get/set whether or not the Buckets hold Real values.
Definition at line 242 of file BucketCollection.cs.
|
get |
Returns the bucket at a given index.
nIdx | Specifies the index of the bucket to retrieve. |
Definition at line 261 of file BucketCollection.cs.
|
get |
Returns the total count across all buckets.
Definition at line 566 of file BucketCollection.cs.