Problem is to compare a given student answer to faculty given the modal answer or correct answer and assign grades to the student answer. After researching a lot, Siamese architecture with LSTMs seems to be a very good choice for the neural network…
I trained a DNN using Keras. However, I am unable to save and load the model.
from keras.models import load_model
model.save('/home/ubuntu/pynb/savedmodel.tfl')
#model.load('/home/ubuntu/pynb/savedmodel.tfl')
But I find that instead of…
I'm migrating a project from Keras 1.x to 2.x.
In the code, a keras.backend.conv2d operation that was running fine in 1.x now crashes in 2.x.
convs = K.conv2d(a, b, padding='valid', data_format='channels_first')
Input tensors shapes a and b are…
I want to resize a tensor (between layers) of size say (None, 2, 7, 512) to (None, 2, 8, 512), by interpolating it (say using nearest neighbor), similar to this function tf.image.resize_nearest_neighbor available in Tensorflow.
Is there any way to…
I created a custom initializer with Keras. Part of the code is:
def my_init(shape):
P = tf.get_variable("P", shape=shape, initializer = tf.contrib.layers.xavier_initializer())
return P
model = Sequential()
model.add(Conv2D(32,…
I'm training a model using Conv2D and started to suddenly get a high top k categorical accuracy that is 1.0 but very low categorical accuracy (close to 0.006).
I have 108 different categories so the only thing I can think of that would cause it is…
Could someone help me to understand what this error is all about?
model = Sequential()
model.add(Embedding(82, 100, weights=[embedding_matrix], input_length=1000))
model.add(LSTM(100))
model.add(Dense(100, activation =…
I have NN based on InceptionV3.
Feeding it batches during epochs gives good results like:
loss: 0.3596 - acc: 0.8479 - val_loss: 0.3442 - val_acc: 0.8515
After training was done I have decided to check training accuracy on the whole training…
I am using custom softmax function. I am trying to use shape of tensor x as an element of shape of new tensor of zeros. It can not be done since it is not int.
def custom_softmax(x):
sh = K.shape(x)
...
xc = K.zeros((sh[0] * 16 *…
I am using l2_regularization
Tensorflow has - tf.nn.l2_loss
Can I use this?
K.sum(K.square(K.abs(Weights)))
tf.nn.l2_loss
Can I use this interchangeably in Keras (Tensorflow backend)?
I'm learning how to work with Keras with TF backend for image recognition so I'm still not sure about what am I doing wrong here.
I'm trying to stack 2 models, one being VGG16, and the other one being a random one I made just to learn how to stack…
I'm unable to save the model trained using KerasRegressor wrapper...
model = KerasRegressor(build_fn=base_model, epochs=1, batch_size=10, verbose=1)
model.fit(X,Y)
model_json = model.to_json()
with open("model.json", "w") as json_file:
…
I'm trying to train a sparse model, that is some of the model parameters have to remain zero during optimization.
Is this possible in Keras to define a mask for the parameters so that the optimizer would not update masked ones?
Unfortunately,…
How can I use the PReLU activation function with an variable input size?
from keras.layers import Conv2D, Input
from keras.layers.advanced_activations import PReLU
X = Input(shape=(None,None,1))
conv1Y = Conv2D(filters=49, kernel_size=7,…
I am using a simple Keras model for series prediction.
I am feeding it input normalized across the entire series.
The model prediction accuracy seems to be correct during training. However, when I plot the outputs of the model.predict() function, I…