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

Method load

rnn_class/srn_language.py:128–142  ·  view source on GitHub ↗
(filename, activation)

Source from the content-addressed store, hash-verified

126
127 @staticmethod
128 def load(filename, activation):
129 # TODO: would prefer to save activation to file too
130 npz = np.load(filename)
131 We = npz['arr_0']
132 Wx = npz['arr_1']
133 Wh = npz['arr_2']
134 bh = npz['arr_3']
135 h0 = npz['arr_4']
136 Wo = npz['arr_5']
137 bo = npz['arr_6']
138 V, D = We.shape
139 _, M = Wx.shape
140 rnn = SimpleRNN(D, M, V)
141 rnn.set(We, Wx, Wh, bh, h0, Wo, bo, activation)
142 return rnn
143
144 def set(self, We, Wx, Wh, bh, h0, Wo, bo, activation):
145 self.f = activation

Callers 5

find_analogiesFunction · 0.45
mainFunction · 0.45
find_analogiesFunction · 0.45
generate_poetryFunction · 0.45

Calls 2

setMethod · 0.95
SimpleRNNClass · 0.70

Tested by

no test coverage detected