Module¶
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 modules.
Initializing¶
def __init__(self, name=None):
Parameters
Parameter | Allowed types | Description | Default |
---|---|---|---|
name | str | Name of the module. | None |
Explanations
name
- name of the module, that is used when saving the model weights to a file.
Methods¶
registerBlueprint
¶
def registerBlueprint(self, args, exclude=None):
-
Parameters
-
Explanations
-
getBlueprint
¶
def getBlueprint(self):
-
Parameters
-
Explanations
-
setVar
¶
def setVar(self, name, var):
-
Parameters
-
Explanations
-
getVar
¶
def getVar(self, name):
-
Parameters
-
Explanations
-
getVarTable
¶
def getVarTable(self, vartable=None, name=None, root=True):
-
Parameters
-
Explanations
-
setAttr
¶
def setAttr(self, name, attr):
-
Parameters
-
Explanations
-
hasAttr
¶
def hasAttr(self, name):
-
Parameters
-
Explanations
-
node
¶
def node(self, *nodes):
-
Parameters
-
Explanations
-
__call__
¶
def __call__(self, data=None):
-
Parameters
-
Explanations
-
backward
¶
def backward(self, grad, updParamGrads=True, updGrad=True, scale=1.0, momentum=0.0):
-
Parameters
-
Explanations
-
updateData
¶
def updateData(self, data):
-
Parameters
-
Explanations
-
updateGrad
¶
def updateGrad(self, grad):
-
Parameters
-
Explanations
-
zeroGradParams
¶
def zeroGradParams(self):
-
Parameters
-
Explanations
-
accGradParams
¶
def accGradParams(self, grad, scale=1.0, momentum=0.0):
-
Parameters
-
Explanations
-
updateParams
¶
def updateParams(self, learnRate):
-
Parameters
-
Explanations
-
optimizeForShape
¶
def optimizeForShape(self, shape, memlimit=None):
-
Parameters
-
Explanations
-
save
¶
def save(self, hdf=None, varlinks=None, name=None, compress="gzip", assumeUniqueNames=False, withBlueprint=False, isRoot=True):
-
Parameters
-
Explanations
-
load
¶
def load(self, hdf, initvars=None, name=None, assumeUniqueNames=False, isRoot=True):
-
Parameters
-
Explanations
-
trainMode
¶
def trainMode(self):
-
Parameters
-
Explanations
-
evalMode
¶
def evalMode(self):
-
Parameters
-
Explanations
-
calcMode
¶
def calcMode(self, T):
-
Parameters
-
Explanations
-
reset
¶
def reset(self):
-
Parameters
-
Explanations
-
checkDataShape
¶
def checkDataShape(self, shape):
-
Parameters
-
Explanations
-
dataShapeFrom
¶
def dataShapeFrom(self, shape):
-
Parameters
-
Explanations
-
checkDataType
¶
def checkDataType(self, dtype):
-
Parameters
-
Explanations
-
checkGradShape
¶
def checkGradShape(self, shape):
-
Parameters
-
Explanations
-
gradShapeFrom
¶
def gradShapeFrom(self, shape):
-
Parameters
-
Explanations
-
checkGradType
¶
def checkGradType(self, dtype):
-
Parameters
-
Explanations
-
genericCheckDataType
¶
def genericCheckDataType(self, dtype):
-
Parameters
-
Explanations
-
__ str __
¶
def __str__(self):
-
Parameters
-
Explanations
-
numOfParams
¶
def numOfParams(self):
-
Parameters
-
Explanations
-
paramSize
¶
def paramSize(self, unit=None):
-
Parameters
-
Explanations
-
convertUnit
¶
@staticmethod
def convertUnit(val, unit):
-
Parameters
-
Explanations
-
repeat
¶
@staticmethod
def repeat(val, ntimes):
-
Parameters
-
Explanations
-
ensureHdf
¶
@staticmethod
def ensureHdf(file, mode):
-
Parameters
-
Explanations
-
acquireShapesFrom
¶
@staticmethod
def acquireShapesFrom(cls, data):
-
Parameters
-
Explanations
--
acquireDtypesFrom
¶
@staticmethod
def acquireDtypesFrom(cls, data):
-
Parameters
-
Explanations
-
calcNeuronsNumber
¶
@classmethod
def calcNeuronsNumber(cls, shape, transpose=False):
-
Parameters
-
Explanations
-
createTensorWithScheme
¶
@staticmethod
def createTensorWithScheme(scheme, shape, wscale, neurons, dtype=np.float32):
-
Parameters
-
Explanations
-