Training a TensorFlow model for regression when labels are probabilities
NickName:boomz Ask DateTime:2016-12-01T09:37:34

Training a TensorFlow model for regression when labels are probabilities

I am going to train a neural network (e.g., a feed-forward network) in which the output is just a real value representing a probability (and thus in the [0, 1] interval). Which activation function shall I use for the last layer (i.e., the output node)?

If I don't use any activation functions and just output tf.matmul(last_hidden_layer, weights) + biases it may result in some negative outputs, which is not acceptable, since the outputs are probabilities and thus the prediction should be also a probability. If I use tf.nn.softmax or tf.nn.softplus the model always returns 0 in the test set. Any suggestion?

Copyright Notice:Content Author:「boomz」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/40901226/training-a-tensorflow-model-for-regression-when-labels-are-probabilities

More about “Training a TensorFlow model for regression when labels are probabilities” related questions

Training a TensorFlow model for regression when labels are probabilities

I am going to train a neural network (e.g., a feed-forward network) in which the output is just a real value representing a probability (and thus in the [0, 1] interval). Which activation function ...

Show Detail

How to specify 2 or more output Labels in a TensorFlow Regression

Using the TensorFlow Regression tutorial (see: https://www.tensorflow.org/tutorials/keras/regression) as a starting point, I'm wanting to extend it to consider 2 output Labels. The model should be

Show Detail

Multiple labels with tensorflow regression

I'm trying to get a multilabel model going in tensorflow. I saw a related question here: Multiple labels with tensorflow, but couldn't get the solution working. The code is from a tensorflow tutor...

Show Detail

Implementing Tensorflow Regression Model on Basketball data

I am following along the following guide to tensorflow regression models: https://www.tensorflow.org/tutorials/keras/basic_regression Using basketball data. I am wanting to predict NBA career length

Show Detail

TensorFlow: predict beyond the evaluation set for a linear regression model

I have been doing the basic linear regression TensorFlow tutorial: https://www.tensorflow.org/tutorials/estimator/linear And I have arrived at the end whereas I have created an evaluation set input

Show Detail

Tensorflow Serving predictions mapped to labels

I am serving up the inception model using TensorFlow serving. I am doing this on Azure Kubernetes so not via the more standard and well documented google cloud. In any event, this is all working h...

Show Detail

Tensorflow 2.0 - do these model predictions represent probabilities?

I have a very simple Tensorflow 2 Keras model to do penalized logistic regression on some data. I was hoping to get the probabilties of each class, instead of just the predicted values of [0 or 1]....

Show Detail

Tensorflow Python: Finished Training DNN Regression Model, predictions wildly vary when executing multiple times

I am using Tensorflow Python, and I am using the DNN Regression Model, to train over some Abalone data. (https://archive.ics.uci.edu/ml/datasets/Abalone) Also to make sure it's clear, I am using J...

Show Detail

Tensorflow NaN loss during training: trying to reshape logits and labels

I have just started to use tensorflow. I am trying to feed some neurons with raw images (944,944) that I later reshape for BINARY classification. Full code is here: import tensorflow as tf import...

Show Detail

Modelling probabilities in a regularized (logistic?) regression model in python

I would like to fit a regression model to probabilities. I am aware that linear regression is often used for this purpose, but I have several probabilities at or near 0.0 and 1.0 and would like to ...

Show Detail