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

Function test_generator

recommenders/autorec.py:80–92  ·  view source on GitHub ↗
(A, M, A_test, M_test)

Source from the content-addressed store, hash-verified

78
79
80def test_generator(A, M, A_test, M_test):
81 # assumes A and A_test are in corresponding order
82 # both of size N x M
83 while True:
84 for i in range(A.shape[0] // batch_size + 1):
85 upper = min((i+1)*batch_size, A.shape[0])
86 a = A[i*batch_size:upper].toarray()
87 m = M[i*batch_size:upper].toarray()
88 at = A_test[i*batch_size:upper].toarray()
89 mt = M_test[i*batch_size:upper].toarray()
90 a = a - mu * m
91 at = at - mu * mt
92 yield a, at
93
94
95

Callers 1

autorec.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected