MCPcopy Create free account
hub / github.com/MorvanZhou/tutorials / get_batch

Function get_batch

kerasTUT/8-RNN_LSTM_Regressor_example.py:32–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30
31
32def get_batch():
33 global BATCH_START, TIME_STEPS
34 # xs shape (50batch, 20steps)
35 xs = np.arange(BATCH_START, BATCH_START+TIME_STEPS*BATCH_SIZE).reshape((BATCH_SIZE, TIME_STEPS)) / (10*np.pi)
36 seq = np.sin(xs)
37 res = np.cos(xs)
38 BATCH_START += TIME_STEPS
39 # plt.plot(xs[0, :], res[0, :], 'r', xs[0, :], seq[0, :], 'b--')
40 # plt.show()
41 return [seq[:, :, np.newaxis], res[:, :, np.newaxis], xs]
42
43model = Sequential()
44# build a LSTM RNN

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected