MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / load

Method load

unsupervised_class2/unsupervised.py:105–121  ·  view source on GitHub ↗
(filename, UnsupervisedModel=AutoEncoder)

Source from the content-addressed store, hash-verified

103
104 @staticmethod
105 def load(filename, UnsupervisedModel=AutoEncoder):
106 dbn = DBN([], UnsupervisedModel)
107 npz = np.load(filename)
108 dbn.hidden_layers = []
109 count = 0
110 for i in range(0, len(npz.files), 3):
111 W = npz['arr_%s' % i]
112 bh = npz['arr_%s' % (i + 1)]
113 bo = npz['arr_%s' % (i + 2)]
114
115 if i == 0:
116 dbn.D = W.shape[0]
117
118 ae = UnsupervisedModel.createFromArrays(W, bh, bo, count)
119 dbn.hidden_layers.append(ae)
120 count += 1
121 return dbn
122
123
124def main():

Callers 1

mainFunction · 0.45

Calls 2

DBNClass · 0.85
createFromArraysMethod · 0.45

Tested by

no test coverage detected