Skip to content

Instantly share code, notes, and snippets.

@hereismari
Last active December 27, 2017 20:52
Show Gist options
  • Select an option

  • Save hereismari/58d7dd0f75bd6e8602ed22120e560b38 to your computer and use it in GitHub Desktop.

Select an option

Save hereismari/58d7dd0f75bd6e8602ed22120e560b38 to your computer and use it in GitHub Desktop.
import tensorflow as tf
def model_fn(features, labels, mode):
# Deve conter os seguintes passos:
# 1. Definir o modelo via TF
# 2. Definir como gerar predições
# 3. Definir a loss function para treino e avaliação
# 4. Definir como otimizar o modelo (optimizer)
# 5. Definir métricas para avaliação
# 6. Retornar um EstimatorSpec definindo os passos acima
return tf.estimator.EstimatorSpec(mode, predictions, loss, train_op, eval_metric_ops)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment