Questions tagged [tf.keras]

[tf.keras] is TensorFlow's implementation of the Keras API specification. Use the tag for questions specific to this TensorFlow module. You might also add the tag [keras] to your question since it has the same API.

is TensorFlow's implementation of the Keras API specification. Use the tag for questions specific to this TensorFlow module. You might also add the -tag to your question since it has the same API.

gives you the power and flexibility of Keras within TensorFlow (see the docs for examples). The API of is described here.

References:

2208 questions
0
votes
1 answer

How to calculate and print pearson correlation coefficient as a metric in keras model?

I have a keras model that I am trying to do regression with. I want to print the correlation between y's predicted by the model and the actual y's after each epoch. The model.fit() function only prints train and validation loss by default. How would…
0
votes
1 answer

tell Keras to merge and train layers that do not descend from input?

Consider import tensorflow as tf units=11 entrada=tf.keras.Input(name="entrada", shape=(units,)) unidad= tf.Variable([[1.0]]) # + 0.0*…
arivero
  • 777
  • 1
  • 9
  • 30
0
votes
1 answer

Is it possible to apply sklearn pipeline for deep learning neural network?

Is it possible to apply the sklearn pipeline for deep learning like this: clf = Pipeline( steps=[("preprocessor", preprocessor), ("classifier", LogisticRegression())] ) clf.fit(X_train, y_train) If it's possible, then how can one do it? My…
0
votes
1 answer

Resizing images in preprocessing for inception, how to use batches?

I'm trying to resize some images to use them with Inception. I want to do it as a separate preprocessing step to speed things up later. Running tf.image.resize on all of the images at once crashes, as does a loop. I'd like to do it in batches, but I…
0
votes
1 answer

change tf.contrib.layers.xavier_initializer_conv2d to 2.0.0

How can I change tf.contrib.layers.xavier_initializer_conv2d to 2.0.0 so that I can use it in the context of tensorflow-2.0.0. Thank you!
Hello
  • 3
  • 2
0
votes
0 answers

A `Concatenate` layer should be called on a list of at least 1 input

I am trying to concatenate two layers by using Keras and TensorFlow.I keep getting the error at the concatenate line. I have tried other suggestions from similar questions but it keeps giving the same error. I feel that I'm doing some mistakes but I…
Julia
  • 3
  • 4
0
votes
0 answers

Allocation issues when tensorflow isn't limited to a single thread

I'm using a TensorFlow Keras (python) model to process images. As mentioned in almost all my previous posts, TensorFlow gives me allocation errors at almost any resolution, and it's really problematic, since I need to procecss 12k (downscalling is…
Lynet _101
  • 41
  • 5
0
votes
1 answer

Should I use reguaization with Loss function or NN layer?

I'm confused regarding the place of using regularization. In the theory, I saw regularization has been used with the Loss function. But in the time implementation in Keras, I saw regularization has been used in the neural network layer. from keras…
kowser66
  • 125
  • 1
  • 8
0
votes
1 answer

How to work with 3D images in Keras ImageDataGenerator flow_from_dataframe

I want to estimate numerical values using 3D images, so i want to combine 3D CNN with Regression. I am working on 3D image data stored as .raw files with shape (200,200,200). When I try to use Keras ImageDataGenerator for fitting the model it throws…
0
votes
0 answers

How can I get non-negative outputs in time series forecasting using LSTM

I am doing a prediction for time series data using lstm keras. The train does not contain any negative numbers. The issue is, when the predicting test data, the outputted prediction sometimes is negative, which does not make sense in my application.…
0
votes
1 answer

Multi Input Keras Model with Tfdata

I have a model I am trying to set up with 8 inputs. The first 7 are length 1 IDs that are each fed into embedding layers and these outputs are concatenated with a set of 4 numeric variables. So in the model definition includes: input_A =…
B_Miner
  • 1,840
  • 4
  • 31
  • 66
0
votes
1 answer

Tensorflow all variables only returns weights

I have a Tensorflow v1 session graph (trained) and want to retrieve the weights and biases from it to input them into a Keras model with the same architecture. I have managed to get all the weights with the following calls, but not the biases. I…
Alberto
  • 396
  • 4
  • 11
0
votes
1 answer

Generate smaller tensors for each sequence of values

Consider this tensor. a = tf.constant([0,1,2,3,5,6,7,8,9,10,19,20,21,22,23,24]) I want to divide it into 3 tensors (for this specific example), containing the groups where the numbers are immediately adjacent. The expected output would…
Kunis
  • 576
  • 7
  • 24
0
votes
1 answer

Online vs Offline data augmentation

I can do online or "on the fly" Image augmentation layers or using Image Data Generator Or I can do augmentation and the save the relevant images on hard disk. What is the advantages / disadvantages of each approach ? I don't consider the storage…
Michael D
  • 1,711
  • 4
  • 23
  • 38
0
votes
0 answers

How to freeze the first 10 layers in the TFHub model?

I am trying to make the first 10 layers in this TFHub model to be non-traininable. I want to freeze those layers so that I can finetune the remaining layers. I could not find any example to do this. I have seen similar examples in Keras models such…
learner
  • 2,582
  • 9
  • 43
  • 54