I am trying to use conv1d functions to make a transposed convlotion repectively at jax and tensorflow. I read the documentation of both of jax and tensorflow for the con1d_transposed operation but they are resulting with different outputs for the same input. I can not find out what the problem is. And I don’t know which one produces the correct
Tag: tensorflow
Keras Confusion Matrix does not look right
I am running a Keras model on the Breast Cancer dataset. I got around 96% accuracy with it, but the confusion matrix is completely off. Here are the graphs: And here is my confusion matrix: The matrix is saying that I have no true negatives and they’re actually false negatives, when I believe that it’s the reverse. Another thing that
How do I read two folders in a directory and combine them under one label using flow_from_directory?
Tensorflow/Keras I want to classify images into either “Circle”, “Square” or “Triangle”. I have a directory containing 6 folders with each shape having a separate “shaded” or “unshaded” folder. How can I combine them into one category? For example: shaded and unshaded circles will be given a label “0” using flow_from_directory. I will then feed this into my CNN model
How to normalize data using Lambda layer?
I have the x list as and I can create windowed dataset using the below method: which gives me the output result. So, each row contains of a tuple which the the first element is a list with multiple and the second element is a list with single element. Now i wish to normalize (between 0 and 1) only the
How to import utils from keras_unet
I’m trying to add utils from keras_unet in google colab, but I have a problem. keras-unet init: TF version is >= 2.0.0 – using tf.keras instead of Keras ModuleNotFoundError Answer You must install keras-unet before importing as follows Let us know if the issue still persists. Thanks!
How does Tokenizer in tensorflow deal with out of vocabulary tokens if I don’t provide oov_token?
I didn’t get any error with that code even though I didn’t provide oov_token argument. I expected to get an error in test_tweets = tokenizer.texts_to_sequences(X_test) How does tensorflow deal with out of vocabulary words during the test time when you don’t provide the oov_token? Answer OOV words will be ignored / discarded by default, if oov_token is None:
Compile model which has different dimensions of output and labels (in Tensorflow)
Simplest examples which replicates the error: I understand, that in this case, output of model is (batch_size, 10) while my labels have (batch_size,) dimensions. This is why I use tf.nn.sparse_softmax_cross_entropy_with_logits. Before I can provide any kind of labels to this model, compilation fails with the following error: After some investigation, I see that compilation fails because tensorflow somehow thinks that
Behavior of steps_per_epoch and validation_steps in Keras Model
I’m a little bit confused on the behavior of steps_per_epoch and validation_steps in the fit function. More particularly, if I set steps_per_epoch to be smaller than total_records/batch_size, would it be that a) the model only trains on the same subset of training data for every epoch or b) the model will use different training data for each epoch and will
Tensorflow Keras Tensor Multiplication with None as First Dimension
I’m using TensorFlow Keras backend and I have two tensors a, b of the same shape: (None, 4, 7), where None represents the batch dimension. I want to do matrix multiplication, and I’m expecting a result of (None, 4, 4). i.e. For each batch, do one matmul: (4,7)ยท(7,4) = (4,4) Here’s my code — This code gives a tensor of
Tensorflow ValueError: Shapes (64, 1) and (1, 1) are incompatible
I’m trying to build a Siamese Neural Network to analyze the MNIST dataset, however when trying to fit the model to the dataset I encounter this problem according to which I have training data and labels shapes’ mismatch. I tried changing the loss function as well as tried to squeeze the labels array, and neither of “solutions” worked. Here are