示例#1
0
 def __init__(self, numvis, numhid, vislayer=None, hidlayer=None, vishid=None):
     '''Initialize an RBM with numvis visible units and numhid hidden units. The weights are randomly initialized
     explicitly passed in as a parameter.'''
     self.numvis = numvis
     self.numhid = numhid
     weights = [vishid] if vishid is not None else None
     NeuralNet.__init__(self, [vislayer or BinaryStochasticLayer(numvis), hidlayer or BinaryStochasticLayer(numhid)], weights)
示例#2
0
 def __init__(self,
              numvis,
              numhid,
              vislayer=None,
              hidlayer=None,
              vishid=None):
     '''Initialize an RBM with numvis visible units and numhid hidden units. The weights are randomly initialized
     explicitly passed in as a parameter.'''
     self.numvis = numvis
     self.numhid = numhid
     weights = [vishid] if vishid is not None else None
     NeuralNet.__init__(self, [
         vislayer or BinaryStochasticLayer(numvis), hidlayer
         or BinaryStochasticLayer(numhid)
     ], weights)