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

Method load

rnn_class/srn_language_tf.py:174–188  ·  view source on GitHub ↗
(filename, activation, session)

Source from the content-addressed store, hash-verified

172
173 @staticmethod
174 def load(filename, activation, session):
175 # TODO: would prefer to save activation to file too
176 npz = np.load(filename)
177 We = npz['arr_0']
178 Wx = npz['arr_1']
179 Wh = npz['arr_2']
180 bh = npz['arr_3']
181 h0 = npz['arr_4']
182 Wo = npz['arr_5']
183 bo = npz['arr_6']
184 V, D = We.shape
185 _, M = Wx.shape
186 rnn = SimpleRNN(D, M, V, activation, session)
187 rnn.build(We, Wx, Wh, bh, h0, Wo, bo)
188 return rnn
189
190 def generate(self, pi, word2idx):
191 # convert word2idx -> idx2word

Callers 1

generate_poetryFunction · 0.45

Calls 2

buildMethod · 0.95
SimpleRNNClass · 0.70

Tested by

no test coverage detected