conv-neural-network

What does the coordinate output of yolo algorithm represent?

戏子无情 提交于 2021-02-08 05:16:57
问题 My question is similar to this topic. I was watching this lecture on bounding box prediction by Andrew Ng when I started thinking about output of yolo algorithm. Let's consider this example, We use 19x19 grids and only one receptive field with 2 classes, so our output will be => 19x19x1x5. The last dimension(array of size 5) represents the following: 1) The class (0 or 1) 2) X-coordinate 3) Y-coordinate 4) height of the bounding box 5) Width of the bounding box I don't understand whether X,Y

How to experiment with custom 2d-convolution kernels in Keras?

微笑、不失礼 提交于 2021-02-07 14:33:25
问题 In a default Conv2D layer with kernel_size=3 the weights of a slice of one of the filters could be named like this: A B C D E F G H I With kernel_size=5 like this: A B C D E F G H I J K L M N O P Q R S T U V W X Y Now I'd like to build (and train/test) a model based on conv layers with kernels like that: A A B C C A A B C C D D E F F G G H I I G G H I I How could the implementation of such a custom layer look like? 回答1: Maybe like this? class CustomConv2D(Layer): def __init__(self, filters, *

Why are my results still not reproducible?

≯℡__Kan透↙ 提交于 2021-02-07 06:39:11
问题 I want to get reproducible results for a CNN. I use Keras and Google Colab with GPU. In addition to recommendations to insert certain code snippets, which should allow a reproducibility, I also added seeds to the layers. ###### This is the first code snipped to run ##### !pip install -U -q PyDrive from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive from google.colab import auth from oauth2client.client import GoogleCredentials # Authenticate and create the PyDrive client

Changing the scale of a tensor in tensorflow

為{幸葍}努か 提交于 2021-02-07 05:14:26
问题 Sorry if I messed up the title, I didn't know how to phrase this. Anyways, I have a tensor of a set of values, but I want to make sure that every element in the tensor has a range from 0 - 255, (or 0 - 1 works too). However, I don't want to make all the values add up to 1 or 255 like softmax, I just want to down scale the values. Is there any way to do this? Thanks! 回答1: You are trying to normalize the data. A classic normalization formula is this one: normalize_value = (value − min_value) /

Changing the scale of a tensor in tensorflow

允我心安 提交于 2021-02-07 05:05:49
问题 Sorry if I messed up the title, I didn't know how to phrase this. Anyways, I have a tensor of a set of values, but I want to make sure that every element in the tensor has a range from 0 - 255, (or 0 - 1 works too). However, I don't want to make all the values add up to 1 or 255 like softmax, I just want to down scale the values. Is there any way to do this? Thanks! 回答1: You are trying to normalize the data. A classic normalization formula is this one: normalize_value = (value − min_value) /

How to do zero padding in keras conv layer?

a 夏天 提交于 2021-02-07 00:00:25
问题 I am trying to implement model from scientific article, which says they are using zero padding. Is it possible to configure this padding in keras Conv2D? Only possible values for padding I see are padding: one of "valid" or "same" (case-insensitive). Is it possible to pad with zeros or other constant values? 回答1: "same" means zero padding. It is currently not possible to pad with other constants in an efficient way. 回答2: When you use padding='valid' , there's no padding. When you use padding=

How to do zero padding in keras conv layer?

北慕城南 提交于 2021-02-06 23:59:45
问题 I am trying to implement model from scientific article, which says they are using zero padding. Is it possible to configure this padding in keras Conv2D? Only possible values for padding I see are padding: one of "valid" or "same" (case-insensitive). Is it possible to pad with zeros or other constant values? 回答1: "same" means zero padding. It is currently not possible to pad with other constants in an efficient way. 回答2: When you use padding='valid' , there's no padding. When you use padding=

How to do zero padding in keras conv layer?

你离开我真会死。 提交于 2021-02-06 23:57:02
问题 I am trying to implement model from scientific article, which says they are using zero padding. Is it possible to configure this padding in keras Conv2D? Only possible values for padding I see are padding: one of "valid" or "same" (case-insensitive). Is it possible to pad with zeros or other constant values? 回答1: "same" means zero padding. It is currently not possible to pad with other constants in an efficient way. 回答2: When you use padding='valid' , there's no padding. When you use padding=

Loading images in Keras for CNN from directory but label in CSV file

孤街浪徒 提交于 2021-02-05 09:34:27
问题 I have a set of image files in a directory train_images = './data/images' and train_labels = './data/labels.csv' For example - There are 1000 images in train_images as 377.jpg,17814.jpg .... and so on. And the class they correspond to are saved in a different CSV file. EDIT - Here are a few rows from the CSV file - >> ID Class 0 377.jpg MIDDLE 1 17814.jpg YOUNG 2 21283.jpg MIDDLE 3 16496.jpg YOUNG 4 4487.jpg MIDDLE Here I.D is the image file name and the class is the class it is associated to

Scipy ndimage.convolve skips the summation of channels

旧时模样 提交于 2021-02-05 08:37:10
问题 I'm trying to use scipy 's ndimage.convolve function to perform a convolution on a 3 dimensional image (RGB, width, height). Taking a look here: It is clear to see that for any input, each kernel/filter should only ever have an output of NxN , with strictly a depth of 1. This is a problem with scipy , as when you do ndimage.convolve with an input of size (3, 5, 5) and a filter/kernel of size (3, 3, 3) , the result of this operation produces an output size of (3, 5, 5) , clearly not summing