deep-learning

How to initialize sample weights for multi-class segmentation?

假装没事ソ 提交于 2020-04-28 21:07:55
问题 I'm working on multi-class segmentation using Keras and U-net. I have as output of my NN 12 classes using soft max Activation function. the shape of my output is (N,288,288,12). to fit my model I use sparse_categorical_crossentropy. I want to initialize weights of my model for my unbalanced dataset. I found this useful link and try it to implement it; since class_weight in Keras does not work for more than 2 classes, I used sample weights My code is : inputs = tf.keras.layers.Input((IMG_WIDHT

How to initialize sample weights for multi-class segmentation?

℡╲_俬逩灬. 提交于 2020-04-28 20:45:53
问题 I'm working on multi-class segmentation using Keras and U-net. I have as output of my NN 12 classes using soft max Activation function. the shape of my output is (N,288,288,12). to fit my model I use sparse_categorical_crossentropy. I want to initialize weights of my model for my unbalanced dataset. I found this useful link and try it to implement it; since class_weight in Keras does not work for more than 2 classes, I used sample weights My code is : inputs = tf.keras.layers.Input((IMG_WIDHT

How to initialize sample weights for multi-class segmentation?

假如想象 提交于 2020-04-28 20:45:02
问题 I'm working on multi-class segmentation using Keras and U-net. I have as output of my NN 12 classes using soft max Activation function. the shape of my output is (N,288,288,12). to fit my model I use sparse_categorical_crossentropy. I want to initialize weights of my model for my unbalanced dataset. I found this useful link and try it to implement it; since class_weight in Keras does not work for more than 2 classes, I used sample weights My code is : inputs = tf.keras.layers.Input((IMG_WIDHT

How to initialize sample weights for multi-class segmentation?

我们两清 提交于 2020-04-28 20:44:03
问题 I'm working on multi-class segmentation using Keras and U-net. I have as output of my NN 12 classes using soft max Activation function. the shape of my output is (N,288,288,12). to fit my model I use sparse_categorical_crossentropy. I want to initialize weights of my model for my unbalanced dataset. I found this useful link and try it to implement it; since class_weight in Keras does not work for more than 2 classes, I used sample weights My code is : inputs = tf.keras.layers.Input((IMG_WIDHT

How to initialize sample weights for multi-class segmentation?

懵懂的女人 提交于 2020-04-28 20:44:01
问题 I'm working on multi-class segmentation using Keras and U-net. I have as output of my NN 12 classes using soft max Activation function. the shape of my output is (N,288,288,12). to fit my model I use sparse_categorical_crossentropy. I want to initialize weights of my model for my unbalanced dataset. I found this useful link and try it to implement it; since class_weight in Keras does not work for more than 2 classes, I used sample weights My code is : inputs = tf.keras.layers.Input((IMG_WIDHT

How to draw multiple lines on a video frame using python by mouse click events

冷暖自知 提交于 2020-04-18 05:41:30
问题 I have a code which draws a line on a video frame using opencv python. But in my case, actually I need to draw 3 lines on the same frame one by one. Which means drawing one line followed by another like that. This is the code I have import cv2 import numpy as np drawing=False # true if mouse is pressed mode=True # if True, draw rectangle. Press 'm' to toggle to curve # mouse callback function class getPoints: def __init__(self,frame,points): self.frame = frame self.points = points def

Data shuffling for Image Classification

╄→гoц情女王★ 提交于 2020-04-17 22:50:44
问题 I want to develop a CNN model to identify 24 hand signs in American Sign Language. I created a custom dataset that contains 3000 images for each hand sign i.e. 72000 images in the entire dataset. For training the model, I would be using 80-20 dataset split (2400 images/hand sign in the training set and 600 images/hand sign in the validation set). My question is: Should I randomly shuffle the images when creating the dataset? And Why? Based on my previous experience, it led to validation loss

If then inside custom non-trainable keras layer

送分小仙女□ 提交于 2020-04-17 22:06:02
问题 I have a custom Keras layer that I want to return specific output from specific inputs. I don't want it to be trainable. The layer should do the following if input = [1,0] then output = 1 if input = [0,1] then output = 0 Instead, it always outputs -1, the value I set if there's problem. I think the line that is not behaving as I expect it would is: if(test_mask_1_result_count == 2) Here's the custom layer: class my_custom_layer(layers.Layer): def __init__(self, **kwargs): super(my_custom

CNN Model predict one class and accuracy is 99%

隐身守侯 提交于 2020-04-17 21:15:37
问题 I am facing a serious issue and could't find any solution yet. Objective is : I am trying to make captcha recognition , I separated the images of letters and numbers, preprocessed images and build the model then try on real data and the result is all one class : it is not the only result as most of the prediction are all ssss for a model and 1111 if I tried another try and this is a sample from input images: most of the data are clear with no black pieces around letters here is the steps and

R- Custom Keras Layer With Weight Constraints

三世轮回 提交于 2020-04-17 20:35:05
问题 I'm trying to write a custom Keras layer with trainable weights in R which: Takes an input vector x and returns the value exp(A * X*A) where $A$ is diagonal and trainable.. Where exp is the matrix exponential map. 回答1: Notice that it's very important that you understand where your batch size is, and that a layer CANNOT have weights with sizes based on the batch size (unless you define your inputs with batch_shape or batch_input_shape instead of shape -- this will force you to use a fixed