neural-network

Neural network: How to calculate the error for a unit

不羁岁月 提交于 2021-01-23 08:07:54
问题 I am trying to work out question 26 from this exam paper (the exam is from 2002, not one I'm getting marked on!) This is the exact question: The answer is B. Could someone point out where I'm going wrong? I worked out I1 from the previous question on the paper to be 0.982. The activation function is sigmoid. So should the sum be, for output 1: d1 = f(Ik)[1-f(Ik)](Tk-Zk) From the question: T1 = 0.58 Z1 = 0.83 T1 - Z1 = -0.25 sigmoid(I1) = sigmoid(0.982) = 0.728 1-sigmoid(I1) = 1-0.728 = 0.272

Confusion matrix of 10 fold cross validation

笑着哭i 提交于 2021-01-22 05:04:31
问题 I am trying to perform 10 fold cross validation for analysing the results of my character recognition project using neural networks in matlab. I know how to calculate the confusion matrix for each fold. But the problem is i dont know how to calculate the confusion matrix averaged over the 10 folds. 回答1: If you have the confusion matrices for each fold, you can simply sum their values to get the total confusion matrix. For example, if you had two folds,and the resulting confusion matrices were

Confusion matrix of 10 fold cross validation

空扰寡人 提交于 2021-01-22 05:01:07
问题 I am trying to perform 10 fold cross validation for analysing the results of my character recognition project using neural networks in matlab. I know how to calculate the confusion matrix for each fold. But the problem is i dont know how to calculate the confusion matrix averaged over the 10 folds. 回答1: If you have the confusion matrices for each fold, you can simply sum their values to get the total confusion matrix. For example, if you had two folds,and the resulting confusion matrices were

Keras Model for Siamese Network not Learning and always predicting the same ouput

做~自己de王妃 提交于 2021-01-21 05:55:12
问题 I am trying to train a Siamese neural network using Keras, with the goal of identifying if 2 images belong to same class or not. My data is shuffled and has equal number of positive examples and negative examples. My model is not learning anything and it is predicting the same output always. I am getting the same loss, validation accuracy, and validation loss every time. Training Output def convert(row): return imread(row) def contrastive_loss(y_true, y_pred): margin = 1 square_pred = K

Share weights between two dense layers in keras

て烟熏妆下的殇ゞ 提交于 2021-01-20 18:20:52
问题 I have a code as follows. What I want to do is to share the same weights in two dense layers. The equation for op1 and op2 layer will be like that op1 = w1y1 + w2y2 + w3y3 + w4y4 + w5y5 + b1 op2 = w1z1 + w2z2 + w3z3 + w4z4 + w5z5 + b1 here w1 to w5 weights are shared between op1 and op2 layer inputs which are (y1 to y5) and (z1 to z5) respectively. ip_shape1 = Input(shape=(5,)) ip_shape2 = Input(shape=(5,)) op1 = Dense(1, activation = "sigmoid", kernel_initializer = "ones")(ip_shape1) op2 =

How to compare ROC AUC scores of different binary classifiers and assess statistical significance in Python? (p-value, confidence interval)

三世轮回 提交于 2021-01-20 16:50:57
问题 I would like to compare different binary classifiers in Python. For that, I want to calculate the ROC AUC scores, measure the 95% confidence interval (CI) , and p-value to access statistical significance. Below is a minimal example in scikit-learn which trains three different models on a binary classification dataset, plots the ROC curves and calculates the AUC scores. Here are my specific questions: How to calculate the 95% confidence interval (CI) of the ROC AUC scores on the test set? (e.g

How to compare ROC AUC scores of different binary classifiers and assess statistical significance in Python? (p-value, confidence interval)

岁酱吖の 提交于 2021-01-20 16:42:37
问题 I would like to compare different binary classifiers in Python. For that, I want to calculate the ROC AUC scores, measure the 95% confidence interval (CI) , and p-value to access statistical significance. Below is a minimal example in scikit-learn which trains three different models on a binary classification dataset, plots the ROC curves and calculates the AUC scores. Here are my specific questions: How to calculate the 95% confidence interval (CI) of the ROC AUC scores on the test set? (e.g

How to compare ROC AUC scores of different binary classifiers and assess statistical significance in Python? (p-value, confidence interval)

我的未来我决定 提交于 2021-01-20 16:42:33
问题 I would like to compare different binary classifiers in Python. For that, I want to calculate the ROC AUC scores, measure the 95% confidence interval (CI) , and p-value to access statistical significance. Below is a minimal example in scikit-learn which trains three different models on a binary classification dataset, plots the ROC curves and calculates the AUC scores. Here are my specific questions: How to calculate the 95% confidence interval (CI) of the ROC AUC scores on the test set? (e.g

CNN - Image Resizing VS Padding (keeping aspect ratio or not?)

匆匆过客 提交于 2021-01-20 14:31:41
问题 While usually people tend to simply resize any image into a square while training a CNN (for example resnet takes a 224x224 square image), that looks ugly to me, especially when the aspect ratio is not around 1. (In fact that might change ground truth eg the label that an expert might give the distorted image could be different than the original one). So now I resize the image to,say, 224x160 , keeping the original ratio, and then I pad the image with 0s (paste it into a random location in a

CNN - Image Resizing VS Padding (keeping aspect ratio or not?)

点点圈 提交于 2021-01-20 14:31:03
问题 While usually people tend to simply resize any image into a square while training a CNN (for example resnet takes a 224x224 square image), that looks ugly to me, especially when the aspect ratio is not around 1. (In fact that might change ground truth eg the label that an expert might give the distorted image could be different than the original one). So now I resize the image to,say, 224x160 , keeping the original ratio, and then I pad the image with 0s (paste it into a random location in a