neural-network

Keras hypernetwork implementation?

你离开我真会死。 提交于 2020-08-10 20:43:28
问题 What would be the most straightforward way to implement a hypernetwork in Keras? That is, where one leg of the network creates the weights for another? In particular, I would like to do template matching where I feed the template in to a CNN leg that generates a convolutional kernel for a leg that operates on the main image. The part I'm unsure of is where I have a CNN layer that is fed weights externally, yet the gradients still flow through properly for training. 回答1: The weights leg: For

Keras hypernetwork implementation?

女生的网名这么多〃 提交于 2020-08-10 20:43:09
问题 What would be the most straightforward way to implement a hypernetwork in Keras? That is, where one leg of the network creates the weights for another? In particular, I would like to do template matching where I feed the template in to a CNN leg that generates a convolutional kernel for a leg that operates on the main image. The part I'm unsure of is where I have a CNN layer that is fed weights externally, yet the gradients still flow through properly for training. 回答1: The weights leg: For

Saving the specific layer from within a sequential Keras model

人走茶凉 提交于 2020-08-09 19:05:14
问题 I am building an auto-encoder and training the model so the targeted output is the same as the input. I am using a sequential Keras model. When I use model.predict I would like it to export the array from a specific layer (Dense256) not the output. This is my current model: model = Sequential() model.add(Dense(4096, input_dim = x.shape[1], activation = 'relu')) model.add(Dense(2048, activation='relu')) model.add(Dense(1024, activation='relu')) model.add(Dense(512, activation='relu')) model

Find input that maximises output of a neural network using Keras and TensorFlow

我的梦境 提交于 2020-08-04 05:33:30
问题 I have used Keras and TensorFlow to classify the Fashion MNIST following this tutorial . It uses the AdamOptimizer to find the value for model parameters that minimize the loss function of the network. The input for the network is a 2-D tensor with shape [28, 28], and output is a 1-D tensor with shape [10] which is the result of a softmax function. Once the network has been trained, I want to use the optimizer for another task: find an input that maximizes one of the elements of the output

Find input that maximises output of a neural network using Keras and TensorFlow

点点圈 提交于 2020-08-04 05:33:21
问题 I have used Keras and TensorFlow to classify the Fashion MNIST following this tutorial . It uses the AdamOptimizer to find the value for model parameters that minimize the loss function of the network. The input for the network is a 2-D tensor with shape [28, 28], and output is a 1-D tensor with shape [10] which is the result of a softmax function. Once the network has been trained, I want to use the optimizer for another task: find an input that maximizes one of the elements of the output

Implementing the Rprop algorithm in Keras

淺唱寂寞╮ 提交于 2020-08-02 09:49:10
问题 I am trying to implement the resilient backpropagation optimizer for Keras (link), but the challenging part was being able to perform an update on each individual parameter based on whether its corresponding gradient is positive, negative or zero. I wrote the code below as a start towards implementing the Rprop optimizer. However, I can't seem to find a way to access the parameters individually. Looping over params (as in the code below) returns p, g, g_old, s, wChangeOld at each iteration

Implementing the Rprop algorithm in Keras

回眸只為那壹抹淺笑 提交于 2020-08-02 09:48:09
问题 I am trying to implement the resilient backpropagation optimizer for Keras (link), but the challenging part was being able to perform an update on each individual parameter based on whether its corresponding gradient is positive, negative or zero. I wrote the code below as a start towards implementing the Rprop optimizer. However, I can't seem to find a way to access the parameters individually. Looping over params (as in the code below) returns p, g, g_old, s, wChangeOld at each iteration

How to input data into Keras? Specifically what is the x_train and y_train if I have more than 2 columns?

我与影子孤独终老i 提交于 2020-08-01 07:04:08
问题 How can I input data into keras? What is the structure? Specifically what is the x_train and y_train if I have more than 2 columns? This is the data I want to input: I am trying to define Xtrain in this example Multi Layer Perceptron Neural Network code Keras has in its documentation. (http://keras.io/examples/) Here is the code: from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import SGD model = Sequential() model.add(Dense(64

I modified a few layers to an example of a neural network just to see if I could. What's wrong with it?

我怕爱的太早我们不能终老 提交于 2020-07-23 06:43:11
问题 A simple neural network I found had the layers w1, Relu, and w2. I tried to add a new weight layer in the middle and a second Relu after it. So, the layers are as follows w1, Relu, w_mid, Relu, and w2. It is much much slower than the original 3 layer network if it works at all. I'm not sure if everything is getting a forward pass and if back prop is working across every part it is supposed to. The neural network is from this link. It is the third block of code down the page. This is the code

I modified a few layers to an example of a neural network just to see if I could. What's wrong with it?

天大地大妈咪最大 提交于 2020-07-23 06:42:19
问题 A simple neural network I found had the layers w1, Relu, and w2. I tried to add a new weight layer in the middle and a second Relu after it. So, the layers are as follows w1, Relu, w_mid, Relu, and w2. It is much much slower than the original 3 layer network if it works at all. I'm not sure if everything is getting a forward pass and if back prop is working across every part it is supposed to. The neural network is from this link. It is the third block of code down the page. This is the code