I'm currently building a NN from scratch where we want to identify based on two input variables (X_1 and X_2) what their output will be (0 or 1). I have 2 hidden layers with sigmoid activation on all neurons however I get stuck when calculating the cross-entropy. Suppose in the output layer I have the predictions [0.50, 0.57] however the true output is 0, so [1, 0]. How do I calculate the cross-entropy over this binary output example? Does anyone have any suggestions/tips?
How can I calculate cross-entropy on a sigmoid neural network binary outcome?
346 Views Asked by Tijn van de Luijtgaarden At
1
There are 1 best solutions below
Related Questions in PYTHON
- new thread blocks main thread
- Extracting viewCount & SubscriberCount from YouTube API V3 for a given channel, where channelID does not equal userID
- Display images on Django Template Site
- Difference between list() and dict() with generators
- How can I serialize a numpy array while preserving matrix dimensions?
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Why is my program adding int as string (4+7 = 47)?
- store numpy array in mysql
- how to omit the less frequent words from a dictionary in python?
- Update a text file with ( new words+ \n ) after the words is appended into a list
- python how to write list of lists to file
- Removing URL features from tokens in NLTK
- Optimizing for Social Leaderboards
- Python : Get size of string in bytes
- What is the code of the sorted function?
Related Questions in NEURAL-NETWORK
- How to choose good SURF feature keypoints?
- How to avoid overfitting (Encog3 C#)?
- Run out of VRAM using Theano on Amazon cluster
- Calculating equation from image in Java
- Print output of a Theano network
- Torch Lua: Why is my gradient descent not optimizing the error?
- How can I train a neural (pattern recognition) network multiple times in matlab?
- Using Convolution Neural Net with Lasagne in Python error
- Random number of hidden units improves accuracy/F-score on test set
- Matlab example code for deep belief network for classification
- Pybrain Reinforcement Learning Example
- How to speed up caffe classifer in python
- Opencv mlp Same Data Different Results
- Word2Vec Data Setup
- How can I construct a Neural Network in Matlab with matrix of features extracted from images?
Related Questions in CROSS-ENTROPY
- Tensorflow R0.12 softmax_cross_entropy_with_logits ASSERT Error
- Tensorflow - loss starts high and does not decrease
- What is the meaning of the word logits in TensorFlow?
- PyTorch equivalence for softmax_cross_entropy_with_logits
- What is the difference between a sigmoid followed by the cross entropy and sigmoid_cross_entropy_with_logits in TensorFlow?
- How can I create a custom loss function in keras ? (Custom Weighted Binary Cross Entropy)
- How is cross entropy loss work in pytorch?
- tf keras SparseCategoricalCrossentropy and sparse_categorical_accuracy reporting wrong values during training
- How to create weighted cross entropy loss?
- Can you use perplexity to guess the language of a document?
- How to do PyTorch F.cross_entropy?
- Pytorch CrossEntropy Loss, getting error: "RuntimeError: Boolean value of Tensor with more than one value is ambiguous"
- Tensorflow binary classifier with weighted loss function - Why does train history accuracy doesn't match train accuracy?
- Problem replicating a comparison between CE and MSE
- Suppose logits are a 3*4 matrix, and the target is a 1*3, how is cross-entropy loss calculated mathematically?
Related Questions in SIGMOID
- What is the difference between a sigmoid followed by the cross entropy and sigmoid_cross_entropy_with_logits in TensorFlow?
- Tensorflow 2.2 [predictions must be >= 0] [Condition x >= y did not hold element-wise:] [x (dense_1/Sigmoid:0) = ]
- How to get numpy.exp to work with an array as well as a scalar?
- Is there a way to round very large fractions like 3.7625745528893614e-83?
- Why XOR problem works better with bipolar representation?
- Simulate sklearn logistic regression predict_proba with only coefficients and intercept
- ValueError: Input 0 of layer "sequential_17" is incompatible with the layer: expected shape=(None, 6), found shape=(None, 5)
- My one neuron neural network does not work with my dataset
- Activation functions: Softmax vs Sigmoid
- Why is the decoder in an autoencoder uses a sigmoid on the last layer?
- How can I calculate cross-entropy on a sigmoid neural network binary outcome?
- How can I find a good fit for my function?
- How to specifiy a formula for combined linear and sigmoid function
- How to change PyTorch sigmoid function to be steeper
- How to pass on the output of a function to a sigmoid's function?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Here is a function that I wrote and use to calculate the cross-entropy given a list of predictions and a list of true labels.
Here the values in the list of labels
yare each either 0 or 1, and the probabilistic predictions from the network are in the listp.