MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.common.NumpyFile< T > Class Template Reference

The NumpyFile reads data from a numpy file in the base type specified. More...

Inheritance diagram for MyCaffe.common.NumpyFile< T >:

Public Member Functions

 NumpyFile (Log log)
 The constructor. More...
 
void Dispose ()
 Dispose all resources and close the file. More...
 
void Close ()
 Close the file if open. More...
 
void OpenRead (string strFile)
 Open the numpy file for reading, and read in the header information. More...
 
T[] LoadRow (T[] rgVal, int nRowIdx, int nStartIdx=0, int nColumnCount=int.MaxValue)
 Load a single row (or portion of a row) from the numpy file. More...
 
List< T[]> Load (int nStartIdx=0, int nCount=int.MaxValue)
 Load the data from the numpy file, optionally specifying the starting row index and number of rows to read, each row is read in its entirety. More...
 

Properties

Type DataType [get]
 Return the base data type in the Numpy file. More...
 
int[] Shape [get]
 Return the data shape of the data in the Numpy file. More...
 
int Rows [get]
 Returns the number of rows. More...
 
int Columns [get]
 Returns the number of items per row. More...
 
int Fields [get]
 Returns the number of fields per column item. More...
 
int TotalCount [get]
 Returns the total number of items * fields in the data. More...
 

Detailed Description

The NumpyFile reads data from a numpy file in the base type specified.

Template Parameters
TSpecifies the base type (e.g, long, int, float, double).

Definition at line 17 of file NumpyFile.cs.

Constructor & Destructor Documentation

◆ NumpyFile()

The constructor.

Parameters
logSpecifies the output log (or null to ignore).

Definition at line 38 of file NumpyFile.cs.

Member Function Documentation

◆ Close()

void MyCaffe.common.NumpyFile< T >.Close ( )

Close the file if open.

Definition at line 54 of file NumpyFile.cs.

◆ Dispose()

void MyCaffe.common.NumpyFile< T >.Dispose ( )

Dispose all resources and close the file.

Definition at line 46 of file NumpyFile.cs.

◆ Load()

List< T[]> MyCaffe.common.NumpyFile< T >.Load ( int  nStartIdx = 0,
int  nCount = int.MaxValue 
)

Load the data from the numpy file, optionally specifying the starting row index and number of rows to read, each row is read in its entirety.

Parameters
nStartIdx
nCount
Returns
The full set of data read is returned. For example when reading the entire numpy file the returned data is of size row_count x col_size.
Exceptions
ExceptionAn exception is thrown on error.

Definition at line 332 of file NumpyFile.cs.

◆ LoadRow()

T[] MyCaffe.common.NumpyFile< T >.LoadRow ( T[]  rgVal,
int  nRowIdx,
int  nStartIdx = 0,
int  nColumnCount = int.MaxValue 
)

Load a single row (or portion of a row) from the numpy file.

Parameters
rgValSpecifies the array where data is copied (this value is also returned).
nRowIdxSpecifies the row index.
nStartIdxSpecifies the start index into the row (default = 0).
nColumnCountSpecifies the number of items to read from the start index (default = int.MaxValue to read entire row).
Returns
The data read in is returned in the template type specified.
Exceptions
ExceptionAn exception is thrown on error.

Definition at line 290 of file NumpyFile.cs.

◆ OpenRead()

void MyCaffe.common.NumpyFile< T >.OpenRead ( string  strFile)

Open the numpy file for reading, and read in the header information.

Parameters
strFileSpecifies the numpy file to read.
Exceptions
ExceptionAn exception is thrown when trying to read a numpy file in fortran order.

Definition at line 132 of file NumpyFile.cs.

Property Documentation

◆ Columns

int MyCaffe.common.NumpyFile< T >.Columns
get

Returns the number of items per row.

Definition at line 98 of file NumpyFile.cs.

◆ DataType

Return the base data type in the Numpy file.

Definition at line 74 of file NumpyFile.cs.

◆ Fields

int MyCaffe.common.NumpyFile< T >.Fields
get

Returns the number of fields per column item.

Definition at line 106 of file NumpyFile.cs.

◆ Rows

int MyCaffe.common.NumpyFile< T >.Rows
get

Returns the number of rows.

Definition at line 90 of file NumpyFile.cs.

◆ Shape

int [] MyCaffe.common.NumpyFile< T >.Shape
get

Return the data shape of the data in the Numpy file.

Definition at line 82 of file NumpyFile.cs.

◆ TotalCount

int MyCaffe.common.NumpyFile< T >.TotalCount
get

Returns the total number of items * fields in the data.

Definition at line 114 of file NumpyFile.cs.


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