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?
348 views Asked by Tijn van de Luijtgaarden At
1
There are 1 answers
Related Questions in PYTHON
- How to store a date/time in sqlite (or something similar to a date)
- Instagrapi recently showing HTTPError and UnknownError
- How to Retrieve Data from an MySQL Database and Display it in a GUI?
- How to create a regular expression to partition a string that terminates in either ": 45" or ",", without the ": "
- Python Geopandas unable to convert latitude longitude to points
- Influence of Unused FFN on Model Accuracy in PyTorch
- Seeking Python Libraries for Removing Extraneous Characters and Spaces in Text
- Writes to child subprocess.Popen.stdin don't work from within process group?
- Conda has two different python binarys (python and python3) with the same version for a single environment. Why?
- Problem with add new attribute in table with BOTO3 on python
- Can't install packages in python conda environment
- Setting diagonal of a matrix to zero
- List of numbers converted to list of strings to iterate over it. But receiving TypeError messages
- Basic Python Question: Shortening If Statements
- Python and regex, can't understand why some words are left out of the match
Related Questions in NEURAL-NETWORK
- Influence of Unused FFN on Model Accuracy in PyTorch
- How to train a model with CSV files of multiple patients?
- Does tensorflow have a way of calculating input importance for simple neural networks
- My ICNN doesn't seem to work for any n_hidden
- a problem for save and load a pytorch model
- config QConfig in pytorch QAT
- How can I convert a flax.linen.Module to a torch.nn.Module?
- Spiking neural network on FPGA
- Error while loading .keras model: Layer node index out of bounds
- Matrix multiplication issue in a Bidirectional LSTM Model
- Recommended way to use Gymnasium with neural networks to avoid overheads in model.fit and model.predict
- Loss is not changing. Its remaining constant
- Relationship Between Neural Network Distances and Performance
- Mapping a higher dimension tensor into a lower one: (B, F, D) -> (B, F-n, D) in PyTorch
- jax: How do we solve the error: pmap was requested to map its argument along axis 0, which implies that its rank should be at least 1, but is only 0?
Related Questions in CROSS-ENTROPY
- Formula for Cross-Entropy Loss for Vector Inputs
- Medical Binary Classification probability : BCE vs CrossEntropy
- Tensorflow: Incompatible shapes: [1,896] vs. [1,32] [[{{node LogicalAnd_3}}]] [Op:__inference_one_step_on_iterator_6201]
- Accessing the N values of PyTorch's Cross-Entropy loss function
- CrossEntropyLoss loss function type problem
- Why categorical_crossentropy gives 16?
- Is there an easy way to replace fmincon with the cross-entropy method for optimization problems
- Pytorch's `binary_cross_entropy` seems to implement ln(0) = -100. Why?
- What causes this model to not improve?
- Suppose logits are a 3*4 matrix, and the target is a 1*3, how is cross-entropy loss calculated mathematically?
- Problem replicating a comparison between CE and MSE
- 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?
- How to do PyTorch F.cross_entropy?
- Can you use perplexity to guess the language of a document?
Related Questions in SIGMOID
- How do you design a feedforward sigmoidal neural network in simulink in order to find a universal approximator
- Modeling Sigmoid Curve with Time-Dependent Steepness in Python
- My one neuron neural network does not work with my dataset
- ValueError: Input 0 of layer "sequential_17" is incompatible with the layer: expected shape=(None, 6), found shape=(None, 5)
- Transferring function from Desmos to Excel: Error due to SQRT(-ve) number
- Implementation of sigmoid function as input in simulink
- Why my plot cannot show sigmoid graph? Whereas I already input to the function
- What Is the importance of using Relu?
- Parameters that denote the dynamic range, symmetry and slope of the sigmoid function respectively in software WEKA
- Why my tensorflow model is not learning in logistic regression - binary classification problem?
- Positive class in keras binary classification report has a F1 score of zero even if flatten() is used
- Two neural networks - combine sigmoid outputs
- Curve fit and extrapolate for sigmoid function in Python
- Neural network with sigmoid function always get value closer to 0.5 fo XOR
- The neural network after several training epochs has too large sigmoid values and does not learn
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?
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)
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.