application_vnd.jupyter.stderr_output_1.png
import keras as K

import numpy as np

import tensorflow as tf

np.random.seed(4)
tf.set_random_seed(13)

tf.logging.set_verbosity(tf.logging.ERROR)
init = K.initializers.RandomUniform(seed=1)
simple_sgd = K.optimizers.SGD(lr=0.01)
model = K.models.Sequential()
model.add(K.layers.Dense(units=10, input_dim=13, kernel_initializer=init, activation='tanh'))
model.add(K.layers.Dense(units=10, kernel_initializer=init, activation='tanh'))
model.add(K.layers.Dense(units=1, kernel_initializer=init, activation=None))
model.compile(loss='mean_squared_error', optimizer=simple_sgd, metrics=['mse'])

batch_size = 8
max_epochs = 500
print('Iniciando treinamento... ')
h = model.fit(X_train, y_train, batch_size=batch_size, epochs=max_epochs, shuffle=True, verbose=1)
print('Treinamento finalizado \n')