Skip to content

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):
Functionality

-

Parameters

-

Explanations

-

getBlueprint

def getBlueprint(self):
Functionality

-

Parameters

-

Explanations

-

setVar

def setVar(self, name, var):
Functionality

-

Parameters

-

Explanations

-

getVar

def getVar(self, name):
Functionality

-

Parameters

-

Explanations

-

getVarTable

def getVarTable(self, vartable=None, name=None, root=True):
Functionality

-

Parameters

-

Explanations

-

setAttr

def setAttr(self, name, attr):
Functionality

-

Parameters

-

Explanations

-

hasAttr

def  hasAttr(self, name):
Functionality

-

Parameters

-

Explanations

-

node

def node(self, *nodes):
Functionality

-

Parameters

-

Explanations

-

__call__

def __call__(self, data=None):
Functionality

-

Parameters

-

Explanations

-

backward

def backward(self, grad, updParamGrads=True, updGrad=True, scale=1.0, momentum=0.0):
Functionality

-

Parameters

-

Explanations

-

updateData

def updateData(self, data):
Functionality

-

Parameters

-

Explanations

-

updateGrad

def updateGrad(self, grad):
Functionality

-

Parameters

-

Explanations

-

zeroGradParams

def zeroGradParams(self):
Functionality

-

Parameters

-

Explanations

-

accGradParams

def accGradParams(self, grad, scale=1.0, momentum=0.0):
Functionality

-

Parameters

-

Explanations

-

updateParams

def updateParams(self, learnRate):
Functionality

-

Parameters

-

Explanations

-

optimizeForShape

def optimizeForShape(self, shape, memlimit=None):
Functionality

-

Parameters

-

Explanations

-

save

def save(self, hdf=None, varlinks=None, name=None, compress="gzip", assumeUniqueNames=False, withBlueprint=False, isRoot=True):
Functionality

-

Parameters

-

Explanations

-

load

def load(self, hdf, initvars=None, name=None, assumeUniqueNames=False, isRoot=True):
Functionality

-

Parameters

-

Explanations

-

trainMode

def trainMode(self):
Functionality

-

Parameters

-

Explanations

-

evalMode

def evalMode(self):
Functionality

-

Parameters

-

Explanations

-

calcMode

def calcMode(self, T):
Functionality

-

Parameters

-

Explanations

-

reset

def reset(self):
Functionality

-

Parameters

-

Explanations

-

checkDataShape

def checkDataShape(self, shape):
Functionality

-

Parameters

-

Explanations

-

dataShapeFrom

def dataShapeFrom(self, shape):
Functionality

-

Parameters

-

Explanations

-

checkDataType

def checkDataType(self, dtype):
Functionality

-

Parameters

-

Explanations

-

checkGradShape

def checkGradShape(self, shape):
Functionality

-

Parameters

-

Explanations

-

gradShapeFrom

def gradShapeFrom(self, shape):
Functionality

-

Parameters

-

Explanations

-

checkGradType

def checkGradType(self, dtype):
Functionality

-

Parameters

-

Explanations

-

genericCheckDataType

def genericCheckDataType(self, dtype):
Functionality

-

Parameters

-

Explanations

-

__ str __

def __str__(self):
Functionality

-

Parameters

-

Explanations

-

numOfParams

def numOfParams(self):
Functionality

-

Parameters

-

Explanations

-

paramSize

def paramSize(self, unit=None):
Functionality

-

Parameters

-

Explanations

-

convertUnit

@staticmethod
def convertUnit(val, unit):
Functionality

-

Parameters

-

Explanations

-

repeat

@staticmethod
def repeat(val, ntimes):
***Functionality**

-

Parameters

-

Explanations

-

ensureHdf

@staticmethod
def ensureHdf(file, mode):
Functionality

-

Parameters

-

Explanations

-

acquireShapesFrom

@staticmethod
def acquireShapesFrom(cls, data):
Functionality

-

Parameters

-

Explanations

--

acquireDtypesFrom

@staticmethod
def acquireDtypesFrom(cls, data):
Functionality

-

Parameters

-

Explanations

-

calcNeuronsNumber

@classmethod
def calcNeuronsNumber(cls, shape, transpose=False):
Functionality

-

Parameters

-

Explanations

-

createTensorWithScheme

@staticmethod
def createTensorWithScheme(scheme, shape, wscale, neurons, dtype=np.float32):
Functionality

-

Parameters

-

Explanations

-