Created
November 25, 2018 14:48
-
-
Save NMZivkovic/f449b540a24f2ecea70ea8c2d58f8fd6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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