I am Creating a leaf Identification Classifier using the CNN, the Keras and the Tensorflow backends on Windows. I have installed Anaconda, Tensorflow, numpy, scipy and keras.
I installed keras using pip3:
C:\> pip3 list | grep -i keras
Keras …
I load hundres of images with ImageGenerator and its flow_from_dirctory-function from lets say two directories (two classes) in the validation directory (and test directory) with names "cats" and "dogs":
validation_generator =…
I'm trying to create a 3D array that duplicates the elements (a copy of data) with rows remaining the same for both. This is ultimately to be a keras/tensorflow lstm input array (samples, timesteps, features) of a time series, where, for different…
Is it even possible? The model is saved by
ModelCheckpoint(model_path, save_best_only=True, monitor='val_acc', mode='max', save_weights_only=False)
Can I do something like this?
from keras.models import load_model
model =…
I have a very large data set and am using Keras' fit_generator to train a Keras model (tensorflow backend). My data needs to be normalized across the entire data set however when using fit_generator, I have access to relatively small batches of…
I'm especially interested in specificity_at_sensitivity. Looking through the Keras docs:
from keras import metrics
model.compile(loss='mean_squared_error',
optimizer='sgd',
metrics=[metrics.mae,…
As a follow-up from this question:
Concatenate input with constant vector in keras
I am trying to use the suggested solution:
constant=K.variable(np.ones((1,10, 5)))
constant = K.repeat_elements(constant,rep=batch_size,axis=0)
And got the following…
I need to create a loss function for Keras that works with only binary values. In wanted for to transform all the values greater than 0.5 to 1.0, so I did that:
def MyLoss(y_true, y_pred:
y_true_f = K.flatten(y_true)
y_pred_f =…
This is a piece of code I get from github for hierarchical attention network,the code is originally in Keras 1.2.2. now I have to change it to compile with Keras 2.0.5, however, it has such error messages that I could not solve.
The original code is…
I am having issues on Windows 10, Python 3 in Jupyter Notebook properly displaying the Keras progress bar. As you can see from the image attached, the output is all being concatenated as a long string with verbose=1 instead of properly backspacing…
I created a custom activation function with keras, which reduce the channel size by half (max-feature map activation).
Here's what part of the code looks like :
import tensorflow as tf
import keras
from keras.utils.generic_utils import…
Hi I have a model which is based on this https://github.com/igormq/asr-study/tree/keras-2 that is able to just about save okay but is unable to load (either full mode or json/weights) due to the fact the loss isn't defined properly.
inputs =…
I was attempting to use my modification of the example code in the Keras documentation that shows how to set up image_datagen.flow_from_directory() in the case where image masks are being used in place of labels (for image segmentation, where we are…
In keras 1 i used to write
def merge_mode(branches):
return #merge function
Merge([...], output_shape=(num_classes,), mode=merge_mode)
But now in keras 2.0
Merge is deprecated, and you can only add predefined functions like add, average,…
I'm trying to determine the accuracy of my model without training and updating the weights so I've set all of my layers to trainable = False.
When I run fit_generator on a generator with shuffle = False, I get consistent results each time.
When I…