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

Method load

rnn_class/poetry_classifier.py:97–109  ·  view source on GitHub ↗
(filename, activation)

Source from the content-addressed store, hash-verified

95
96 @staticmethod
97 def load(filename, activation):
98 # TODO: would prefer to save activation to file too
99 npz = np.load(filename)
100 Wx = npz['arr_0']
101 Wh = npz['arr_1']
102 bh = npz['arr_2']
103 h0 = npz['arr_3']
104 Wo = npz['arr_4']
105 bo = npz['arr_5']
106 V, M = Wx.shape
107 rnn = SimpleRNN(M, V)
108 rnn.set(Wx, Wh, bh, h0, Wo, bo, activation)
109 return rnn
110
111 def set(self, Wx, Wh, bh, h0, Wo, bo, activation):
112 self.f = activation

Callers

nothing calls this directly

Calls 2

setMethod · 0.95
SimpleRNNClass · 0.70

Tested by

no test coverage detected