Created
November 27, 2018 15:32
-
-
Save ispamm/9963c397db1ce9de7ab85aa8251c361c 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 single_head_cnn_model_fn(features, labels, mode): | |
# Extract the features | |
dense = extract_features(features) | |
# Predictions | |
predictions = tf.layers.dense(inputs=dense, units=2) | |
# Optimizer | |
optimizer = tf.train.AdamOptimizer() | |
# Define the head | |
regression_head = tf.contrib.estimator.regression_head(label_dimension=2) | |
return regression_head.create_estimator_spec(features, mode, predictions, labels[:, 2:8:5], optimizer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment