conv-neural-network

how to expand tensor of multi dim arrays by using Taylor series in tensorflow?

纵然是瞬间 提交于 2020-05-15 02:41:25
问题 I am trying to feed the pixel vector to the convolutional neural network (CNN), where the pixel vector came from image data like cifar-10 dataset. Before feeding the pixel vector to CNN, I need to expand the pixel vector with Taylor expansion. The point is, I figured out how to expand tensor with one dim, but not able to get it right for tensor with dim >2. Can anyone one give me ideas of how to apply Taylor expansion of one dim tensor to tensor dim more than 1? is there any heuristics

Reshaping Keras layers

允我心安 提交于 2020-05-10 04:27:18
问题 I have an input image 416x416. How can I create an output of 4 x 10, where 4 is number of columns and 10 the number of rows? My label data is 2D array with 4 columns and 10 rows. I know about the reshape() method but it requires that the resulted shape has same number of elements as the input. With 416 x 416 input size and max pools layers I can get max 13 x 13 output. Is there a way to achieve 4x10 output without loss of data? My input label data looks like for example like [[ 0 0 0 0] [ 0 0

Reshaping Keras layers

荒凉一梦 提交于 2020-05-10 04:24:39
问题 I have an input image 416x416. How can I create an output of 4 x 10, where 4 is number of columns and 10 the number of rows? My label data is 2D array with 4 columns and 10 rows. I know about the reshape() method but it requires that the resulted shape has same number of elements as the input. With 416 x 416 input size and max pools layers I can get max 13 x 13 output. Is there a way to achieve 4x10 output without loss of data? My input label data looks like for example like [[ 0 0 0 0] [ 0 0

Reshaping Keras layers

折月煮酒 提交于 2020-05-10 04:24:05
问题 I have an input image 416x416. How can I create an output of 4 x 10, where 4 is number of columns and 10 the number of rows? My label data is 2D array with 4 columns and 10 rows. I know about the reshape() method but it requires that the resulted shape has same number of elements as the input. With 416 x 416 input size and max pools layers I can get max 13 x 13 output. Is there a way to achieve 4x10 output without loss of data? My input label data looks like for example like [[ 0 0 0 0] [ 0 0

Convert Functional Model to Sequential Keras

梦想与她 提交于 2020-05-09 10:50:09
问题 I have an autoencoder from which I want to save the model, specifically of the encoder part (or weights, not exactly sure what I need) and then load that into a CNN. My goal for this is to use the autoencoder to learn features of items I want to classify, and then use those weights to start the CNN. I have tried just loading the weights, but they won't load since the two networks are different sizes. I though just importing the whole network would work, but one is sequential and the other is

Convert Functional Model to Sequential Keras

时光怂恿深爱的人放手 提交于 2020-05-09 10:49:09
问题 I have an autoencoder from which I want to save the model, specifically of the encoder part (or weights, not exactly sure what I need) and then load that into a CNN. My goal for this is to use the autoencoder to learn features of items I want to classify, and then use those weights to start the CNN. I have tried just loading the weights, but they won't load since the two networks are different sizes. I though just importing the whole network would work, but one is sequential and the other is

Tensorflow/Keras Conv2D layers with padding='SAME' behave strangely

谁说胖子不能爱 提交于 2020-04-17 22:08:14
问题 My question: A straightforward experiment that I conducted showed that using padding='SAME' in a conv2d layer in Keras/TF is different from using padding='VALID' with a preceding zero-padding layer. How is that possible? Does Keras/TF pads zeros symmetrically around the tensor? Explanation of the experiment - just if you're interested in reading further: I used the onnx2keras package to convert my Pytorch model into keras/TF. When onnx2keras encounters a convolutional layer with padding > 0

Accessing layer's input/output using Tensorflow 2.0 Model Sub-classing

天大地大妈咪最大 提交于 2020-04-13 17:02:25
问题 Working on a university exercise, I used the model sub-classing API of TF2.0. Here's my code (it's the Alexnet architecture, if you wonder...): class MyModel(Model): def __init__(self): super(MyModel, self).__init__() # OPS self.relu = Activation('relu', name='ReLU') self.maxpool = MaxPooling2D(pool_size=(3, 3), strides=(2, 2), padding='valid', name='MaxPool') self.softmax = Activation('softmax', name='Softmax') # Conv layers self.conv1 = Conv2D(filters=96, input_shape=(224, 224, 3), kernel

How to extract convolutional neural network from Keras model object to Networkx DiGraph object keeping weights as an edge attribute?

和自甴很熟 提交于 2020-04-08 18:11:02
问题 The bounty expires in 4 days . Answers to this question are eligible for a +100 reputation bounty. Galen wants to draw more attention to this question: I'm putting this question up for bounty because it has received little attention despite its potential use for myself and other researchers. I'm willing to work those attempting to answer the question both in terms of clarifying and refining the question as we find issues. I'm interested in using the Networkx Python package to perform network

How to extract convolutional neural network from Keras model object to Networkx DiGraph object keeping weights as an edge attribute?

梦想的初衷 提交于 2020-04-08 18:08:19
问题 The bounty expires in 4 days . Answers to this question are eligible for a +100 reputation bounty. Galen wants to draw more attention to this question: I'm putting this question up for bounty because it has received little attention despite its potential use for myself and other researchers. I'm willing to work those attempting to answer the question both in terms of clarifying and refining the question as we find issues. I'm interested in using the Networkx Python package to perform network