Handler¶
Warning
Documentation for the module is under development.
Info
This module is intended primarily for developers who want to better understand the structure of the library, as well as those who are going to implement their own modules.
Description¶
Parent class for all handlers.
Initializing¶
def __init__(self, mod, onBatchFinish=None, batchsize=128):
Parameters
Parameter | Allowed types | Description | Default |
---|---|---|---|
mod | Module | Trainable neural network | - |
onBatchFinish | callable | Function that will be called upon completion of processing of a data batch | None |
batchsize | int | Size of a data batch | 128 |
Explanations
-
Methods¶
handleFromHost
¶
def handleFromHost(self, data, state=None, macroBatchSize=10000, onMacroBatchFinish=None, random=True):
Functionality
-
Parameters
-
Explanations
-
handle
¶
def handle(self, data, state=None, random=True):
Functionality
-
Parameters
-
Explanations
-
getDataSize
¶
@staticmethod
def getDataSize(data):
Functionality
-
Parameters
-
Explanations
-
parseShapeTree
¶
@classmethod
def parseShapeTree(cls, data, onData, auxdata=None):
Functionality
-
Parameters
-
Explanations
-
sliceData
¶
@classmethod
def sliceData(cls, data, idx, batchsize, postSlice):
Functionality
-
Parameters
-
Explanations
-
onMacroBatchStart
¶
def onMacroBatchStart(self, idx, macroBatchSize, state):
Functionality
-
Parameters
-
Explanations
-
onMacroBatchFinish
¶
def onMacroBatchFinish(self, idx, macroBatchSize, state):
Functionality
-
Parameters
-
Explanations
-
handleBatch
¶
def handleBatch(self, batch, idx, state):
Functionality
-
Parameters
-
Explanations
-