I've got a fully-convolutional, pretrained model in a .h5 file.
Now I would like to change the input resolution and train again.
My current approach is to go through all the layers, create a new layer and assign the pretrained weights.
Here is a…
Here is part of get_updates code from SGD from keras(source)
moments = [K.zeros(shape) for shape in shapes]
self.weights = [self.iterations] + moments
for p, g, m in zip(params, grads, moments):
v = self.momentum * m - lr * g # velocity
…
I want to forecast, for example, k next points of a time series using LSTM in Keras.
I construct a data set starting from the beginning of a list containing all the points by selecting 0:p-1 points as input features and next k points i.e. p:p+k-1 as…
I am trying to build a model which classify network attacks (DDoS or BENIGN attack). For this, I am using "ISCX 2017" dataset from https://www.unb.ca/cic/datasets/ids-2017.html. Everything goes fine until I fit the model.
I am getting this error…
A simple example of the following use of tf.tensor_scatter_nd_add is giving me problems.
B = tf.tensor_scatter_nd_add(A, indices, updates)
tensor A is (1,4,4)
A = [[[1. 1. 1. 1.],
[1. 1. 1. 1.],
[1. 1. 1. 1.],
[1. 1. 1. 1.]]]
the…
I define an embedding object with embeddings_constraint:
from tensorflow.keras.layers import Embedding
from tensorflow.keras.constraints import UnitNorm
. . .
emb = Embedding(input_dim, output_dim, name='embedding_name',…
I'm trying to implement a loss function where variables in Convolutional layers are required for calculation. There's one method given by the official documents that involve variables in the loss function:
If this is not the case for your loss…
I am trying to train model with image data-augmentation generators on TensorFlow 2.0, after downloading Kaggle's cats_vs_dogs dataset using below code.
train_datagen = ImageDataGenerator(rescale=1. / 255,
…
The Keras documentation gives, at the very end, an example of a function that gets y_true and y_pred and returns a value, once per batch, and that value gets shown during training.
If I try to implement the Keras Metric class, and look at the other…
I am trying to train my 6000 train dataset and 1000 validation dataset but I have a problem: the program just freezes and hangs during training without any error message .
1970/6000 [========>.....................] - ETA: 1:50:11 - loss: 1.2256 -…
What is the difference of calling the VGG16 model with or without including top layers of the model? I wonder, why the input parameters to the layers are not shown in the model summary when the model is called without including the top layers. I…
I've created an ImageDataGenerator for Keras, and I would like to make sure that it runs in parallel, meaning it generates a batch while Keras processes the previous generated batch. But the parallelism is handled directly by Keras.
Is there simple…
I want to use autoencoders on real life photos (and not simple MNIST digits). I have taken the cats and dog dataset and
train with it. My parameters are:
I stick with a grayscale and a scaled down verson of 128x128 px image and do some…
Text classification by extracting tri-grams and quad-grams features of character level inputs using multiple concatenated CNN layers and passing it to BLSTM layer
submodels = []
for kw in (3, 4): # kernel sizes
model = Sequential()
…