MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.db.stream.MyCaffeStreamDatabase Class Reference

The MyCaffeStreamDatabase provides a streaming data input source to MyCaffe gyms used as input for dynamic, reinforcement learning. More...

Inheritance diagram for MyCaffe.db.stream.MyCaffeStreamDatabase:
System.ComponentModel.Component MyCaffe.db.stream.IXStreamDatabase

Public Member Functions

 MyCaffeStreamDatabase (Log log)
 The constructor. More...
 
 MyCaffeStreamDatabase (IContainer container)
 The constructor. More...
 
void Initialize (QUERY_TYPE qt, string strSchema)
 The Initialize method initializes the streaming database component, preparing it for data queries. More...
 
void Shutdown ()
 Shutdonw the streaming database. More...
 
void AddDirectQuery (IXCustomQuery iqry)
 Add a custom query directly to the streaming database. More...
 
SimpleDatum Query (int nWait)
 Query the next data in the streaming database. More...
 
int[] QuerySize ()
 Returns the query size of the data in the form: [0] = channels [1] = height [2] = width. More...
 
Dictionary< string, float > QueryInfo ()
 The Query information returns information about the data queried such as header information. More...
 
void Reset (int nStartOffset=0)
 Reset the query to the start date used in Initialize, optionally with an offset from the start. More...
 
byte[] ConvertOutput (float[] rg, out string type)
 Converts the output values into the native type used by the first CustomQuery. More...
 
- Public Member Functions inherited from System.ComponentModel.Component
 Component ()
 

Detailed Description

The MyCaffeStreamDatabase provides a streaming data input source to MyCaffe gyms used as input for dynamic, reinforcement learning.

Definition at line 19 of file MyCaffeStreamDatabase.cs.

Constructor & Destructor Documentation

◆ MyCaffeStreamDatabase() [1/2]

MyCaffe.db.stream.MyCaffeStreamDatabase.MyCaffeStreamDatabase ( Log  log)

The constructor.

Parameters
logSpecifies the output log.

Definition at line 29 of file MyCaffeStreamDatabase.cs.

◆ MyCaffeStreamDatabase() [2/2]

MyCaffe.db.stream.MyCaffeStreamDatabase.MyCaffeStreamDatabase ( IContainer  container)

The constructor.

Parameters
containerSpecifies the container.

Definition at line 39 of file MyCaffeStreamDatabase.cs.

Member Function Documentation

◆ AddDirectQuery()

void MyCaffe.db.stream.MyCaffeStreamDatabase.AddDirectQuery ( IXCustomQuery  iqry)

Add a custom query directly to the streaming database.

By default, the streaming database looks in the

'./CustomQuery'

folder relative to the streaming database assembly to look for CustomQuery DLL's that implement the IXCustomQuery interface. When found, these assemblies are added to the list accessible via the schema. Alternatively, custom queries may be added directly using this method.

Parameters
iqrySpecifies the custom query to add.

Definition at line 121 of file MyCaffeStreamDatabase.cs.

◆ ConvertOutput()

byte[] MyCaffe.db.stream.MyCaffeStreamDatabase.ConvertOutput ( float[]  rg,
out string  type 
)

Converts the output values into the native type used by the first CustomQuery.

Parameters
rgSpecifies the raw output data.
typeReturns the output type.
Returns
The converted output data is returned as a byte stream.

Definition at line 177 of file MyCaffeStreamDatabase.cs.

◆ Initialize()

void MyCaffe.db.stream.MyCaffeStreamDatabase.Initialize ( QUERY_TYPE  qt,
string  strSchema 
)

The Initialize method initializes the streaming database component, preparing it for data queries.

Parameters
qtSpecifies the query type to use (see remarks).
strSchemaSpecifies the query schema to use.

Additional settings for each query type are specified in the 'strSettings' parameter as a set of key=value pairs for each of the settings. The following are the query specific settings that are expected for each QUERY_TYPE.

qt = TIME: 'QueryCount' - Specifies the number of items to include in each query. 'Start' - Specifies the start date of the stream. 'TimeSpanInMs' - Specifies the time increment between data items in the stream in milliseconds. 'SegmentSize' - Specifies the segment size of data queried from the database. 'MaxCount' - Specifies the maximum number of items to load into memory for each custom query.

qt = GENERAL: none at this time.

The database schema defines the number of custom queries to use along with their names. A simple key=value; list defines the streaming database schema using the following format:

"ConnectionCount=2; Connection0_CustomQueryName=Test1; Connection0_CustomQueryParam=param_string1 Connection1_CustomQueryName=Test2; Connection1_CustomQueryParam=param_string2"

Each param_string specifies the parameters of the custom query and may include the database connection string, database table, and database fields to query.

Implements MyCaffe.db.stream.IXStreamDatabase.

Definition at line 83 of file MyCaffeStreamDatabase.cs.

◆ Query()

SimpleDatum MyCaffe.db.stream.MyCaffeStreamDatabase.Query ( int  nWait)

Query the next data in the streaming database.

Parameters
nWaitSpecfies the maximum amount of time (in ms.) to wait for data.
Returns
A simple datum containing the data is returned.

Implements MyCaffe.db.stream.IXStreamDatabase.

Definition at line 131 of file MyCaffeStreamDatabase.cs.

◆ QueryInfo()

Dictionary< string, float > MyCaffe.db.stream.MyCaffeStreamDatabase.QueryInfo ( )

The Query information returns information about the data queried such as header information.

Returns
The information about the data is returned.

Implements MyCaffe.db.stream.IXStreamDatabase.

Definition at line 157 of file MyCaffeStreamDatabase.cs.

◆ QuerySize()

int[] MyCaffe.db.stream.MyCaffeStreamDatabase.QuerySize ( )

Returns the query size of the data in the form: [0] = channels [1] = height [2] = width.

Returns
The query size is returned.

Implements MyCaffe.db.stream.IXStreamDatabase.

Definition at line 143 of file MyCaffeStreamDatabase.cs.

◆ Reset()

void MyCaffe.db.stream.MyCaffeStreamDatabase.Reset ( int  nStartOffset = 0)

Reset the query to the start date used in Initialize, optionally with an offset from the start.

Parameters
nStartOffsetOptionally, specifies the offset from the start to use (default = 0).

Implements MyCaffe.db.stream.IXStreamDatabase.

Definition at line 166 of file MyCaffeStreamDatabase.cs.

◆ Shutdown()

void MyCaffe.db.stream.MyCaffeStreamDatabase.Shutdown ( )

Shutdonw the streaming database.

Implements MyCaffe.db.stream.IXStreamDatabase.

Definition at line 105 of file MyCaffeStreamDatabase.cs.


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