My question is simple, what is the validation data passed to model.fit in a Sequential model used for?
And, does it affect how the model is trained (normally a validation set is used, for example, to choose hyper-parameters in a model, but I think…
I tried to implement a weighted binary crossentropy with Keras, but I am not sure if the code is correct. The training output seems to be a bit confusing. After a few epochs I just get an accuracy of ~0.15. I think thats much too less (even for a…
In Keras,
I'm trying to import _obtain_input_shape as follows:
from keras.applications.imagenet_utils import _obtain_input_shape
However, I get the following error:
ImportError: cannot import name '_obtain_input_shape'
The reason I'm trying to…
I am looking for a proper or best way to get variable importance in a Neural Network created with Keras. The way I currently do it is I just take the weights (not the biases) of the variables in the first layer with the assumption that more…
I am training a keras sequential model. I want the learning rate to be reduced when training is not progressing.
I use ReduceLROnPlateau callback.
After first 2 epoch with out progress, the learning rate is reduced as expected. But then its reduced…
I am trying to train a simple neural network with the mnist dataset. For some reason, when I get the history (the parameter returned from model.fit), the validation accuracy is higher than the training accuracy, which is really odd, but if I check…
I'd like to monitor eg. the learning rate during training in Keras both in the progress bar and in Tensorboard. I figure there must be a way to specify which variables are logged, but there's no immediate clarification on this issue on the Keras…
I am adding a dense layer before InceptionResNetV2 model(pre-trained)
This is InceptionResNetV2 output
model_base = InceptionResNetV2(include_top=True, weights='imagenet')
x = model_base.get_layer('avg_pool').output
x = Dense(3,…
I have compiled and trained a keras model with a custom optimizer. I saved the model but when I try to load the model, it throws an error stating ValueError: Unknown optimizer: MyOptimizer. I tried to pass MyOptimizer as a custom object something…
During some feature extraction experiments, I noticed that the 'model.pop()' functionality is not working as expected. For a pretrained model like vgg16, after using 'model.pop()' , model.summary() shows that the layer has been removed (expected…
I am using Keras to build a Network. During the process, I need a layer, which takes an LSTM input, doing nothing, just output exactly the same as input. i.e. if each input record of LSTM is like [[A_t1, A_t2, A_t3, A_t4, A_t5, A_t6]], I am looking…
I am using EarlyStopping from Keras for my deep learning project. The documentations here mentions a very useful idea of restoring best weights. But somehow I am not able to use it yet. I am using Keras 2.2.2/TF 1.10, installed using Anaconda.
Call…
This is preprocessing function of inception v3 in Keras. It is totally different from other models preprocessing.
def preprocess_input(x):
x /= 255.
x -= 0.5
x *= 2.
return x
1. Why there is no mean subtraction?
2. Why there is no…
With Keras2 being implemented into TensorFlow and TensorFlow 2.0 on the horizon, should you use Keras ImageDataGenerator with e.g, flow_from_directory or tf.data from TensorFlow which also can be used with fit_genearator of Keras now?
Will both…