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

Function generator

recommenders/autorec.py:66–77  ·  view source on GitHub ↗
(A, M)

Source from the content-addressed store, hash-verified

64
65
66def generator(A, M):
67 while True:
68 A, M = shuffle(A, M)
69 for i in range(A.shape[0] // batch_size + 1):
70 upper = min((i+1)*batch_size, A.shape[0])
71 a = A[i*batch_size:upper].toarray()
72 m = M[i*batch_size:upper].toarray()
73 a = a - mu * m # must keep zeros at zero!
74 # m2 = (np.random.random(a.shape) > 0.5)
75 # noisy = a * m2
76 noisy = a # no noise
77 yield noisy, a
78
79
80def test_generator(A, M, A_test, M_test):

Callers 1

autorec.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected