Last active
December 26, 2017 15:41
-
-
Save hereismari/b4acb22e11892d38820a8282c69bc70d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import tensorflow as tf | |
# Cria-se uma model function para implementar nosso modelo | |
def model_fn(): | |
pass | |
# Cria-se uma input function que deve ser passada para o Estimator na maior parte | |
# de suas operacoes | |
# input function de treino | |
def train_input_fn(): | |
return dados | |
# input function de avaliacao | |
def eval_input_fn(): | |
return dados | |
# input function para predicao | |
def predict_input_fn(): | |
return dados | |
# cria-se um Estimator a partir da model function | |
estimator = tf.Estimator(model_fn=model_fn()) | |
# Podemos entao chamar os metodos disponiveis no estimator! | |
# treinar modelo | |
estimator.train(input_fn=train_input_fn()) | |
# avaliar modelo | |
estimator.eval(input_fn=eval_input_fn()) | |
# predizer novos valores | |
estimator.predict(input_fn=predict_input_fn()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment