Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def train(self, input_train, input_test, batch_size, epochs):
self._session.run(self._training)
for epoch in range(epochs):
epoch_loss = 0
for i in range(int(input_train.shape[0]/batch_size)):
epoch_input = input_train[ i * batch_size : (i + 1) * batch_size ]
_, c = self._session.run([self._optimizer, self._meansq], feed_dict={self._input_layer: epoch_input, self._real_output: epoch_input})
epoch_loss += c
print('Epoch', epoch, '/', epochs, 'loss:',epoch_loss)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment