I am using Keras 2.3.1 For a ternary (3 classes) classification problem. I use the keras.metrics.AUC() as the metric. I see val_auc_3 at the end of each epoch. I am wondering to know if "val_auc_3" is the average AUC (i.e. [auc(class1 vs all) +…
I would like to use the first layers of a pre-trained model --say in Xception up and including the add_5 layer to extract features from an input. Then pass the output of the add_5 layer to a dense layer that will be trainable.
How can I implement…
Following is the partial code. I am trying to understand what "add" does. Why is the output of Add layer (None, 38, 300) when adding two inputs with different shapes here?
Following is the code in Keras.
image_model = Input(shape=(2048,))
x =…
How does Keras' model.evaluate() work? In particular, how does the batch_size argument affect the calculation?
The documentation says the loss/metrics are calculated as averages over the batches. However, as there is only one scalar output for each…
I'm training autoencoders on 2D images using convolutional layers and would like to put fully connected layers on top of encoder part for classification. My autoencoder is defined as follows (just a simple one for illustration):
def…
I'm trying to concatenate two hidden states of a 2-Bi-LSTM layers
but i want to know first what is the output shape of a concatenation.
Moreover, I would like to know what are the attention mechanisme. To be more explicit how can i do it for two…
I cannot download the Keras MNIST db the simple way due to proxy.
So I have downloaded a local version from here : https://s3.amazonaws.com/img-datasets/mnist.pkl.gz
I am importing that to my notebook with the following code :
import gzip
import…
When I am using early stopping the model trains for one epoch only, which is not what should be doing.
Here is the example without early stopping:
# split a univariate sequence into samples
def split_sequence(sequence, n_steps):
X, y = list(),…
I have installed Tensorflow 2.0
print(tf.__version__)
2.0.0-alpha0
While I can use the to_categorical method I can not import it.
import tensorflow as tf
tf.keras.utils.to_categorical(np.arange(4), num_classes = 4)
array([[1., 0., 0., 0.],
…
To use multi-GPU, I upgrade keras(1.2.0 --> 2.2.4) version.
I don't change any of code, but there is an error.
What is the reason of this ERROR?
I attached the reproducible code below.
As you can see A & B have same shapes, but only testB got the…
I know that got asked already a few time but no answer fit my bill.
I have a csv file with text (newspaper content) and label, column 0 and 1.
I am trying to write my first custom generator for text classification but getting the error
ValueError:…
I am trying to build a sequence to sequence model in Keras using LSTM and dense neural network. The encoder encodes the input, the encoded state and the inputs are then concatenated and fed into a decoder which is an lstm + dense neural network…
I am a new keras learner,i have some question, here is my code:
from keras.layers import Input
img = Input(batch_shape=(10, 3, 32, 32), name='input_img')
print(img.shape)
If I use tensorlow backend , it's print (10, 3, 32, 32).
but if i use theano…