def initParams(self):
        sizes = [self.inputDim]+self.layerSizes+[self.outputDim]
        scales = [np.sqrt(6)/np.sqrt(n+m) for n,m in zip(sizes[:-1],sizes[1:])]
        self.stack = [[np.random.rand(m,n)*2*s-s,np.zeros((m,1))] \
                            for n,m,s in zip(sizes[:-1],sizes[1:],scales)]
        self.hActs_M = [cm.empty((s,self.maxBatch)) for s in sizes]

        if self.train:
            # Now assuming that all layers are the same size
            self.grad = [[cm.empty(w.shape),cm.empty(b.shape)] for w,b in self.stack]
            self.deltasC_M = cm.empty((self.outputDim,self.maxBatch))
            self.deltasOut_M = cm.empty((sizes[1],self.maxBatch)) 
            self.deltasIn_M = cm.empty((sizes[1],self.maxBatch)) 
            self.tmpGrad_M = cm.empty((self.layerSize,self.maxBatch))
 
        # Allocate memory once here and reuse
        # Store probs
        self.probs_M = cm.empty((self.outputDim,self.maxBatch))
        # Store col max
        self.rowVec_M = cm.empty((1,self.maxBatch))
       
        self.stack = [[cm.CUDAMatrix(w),cm.CUDAMatrix(b)]
                    for w,b in self.stack]

        if self.temporalLayer > 0:
            # dummy bias used for temporal layer
            dummy = cm.empty((1,1))
            dummy.assign(0.0)

            scale = np.sqrt(6)/np.sqrt(self.layerSize*2)
            wt = 2*scale*np.random.rand(self.layerSize,self.layerSize)-scale
            wt = cm.CUDAMatrix(wt)
            self.stack.append([wt,dummy])

            if self.train:
                dwt = cm.empty((self.layerSize,self.layerSize))
                self.grad.append([dwt,dummy])

                self.deltaTemp_M = cm.empty((self.layerSize,self.maxBatch))
Initialize parameters using 6/sqrt(fanin+fanout)
dataset/ETHPy150Open amaas/stanford-ctc/ctc_fast/nnets/rnnet.py/NNet.initParams