Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 34269

TensorFlow is an open source library for machine learning and machine intelligence. TensorFlow uses data flow graphs with tensors flowing along edges. For details, see https://www.tensorflow.org. TensorFlow is released under an Apache 2.0 License.

4 votes
Accepted

Tensorflow 2 eager vs graph mode

() my_function = eager_function else: my_function = graph_function # You proceed to my_function from now on I don't know if there is a better way but I've seen this a lot being used in the tensorflow
Djib2011's user avatar
  • 8,038
6 votes
Accepted

What is the advantage of a tensorflow.data.Dataset over a tensorflow.Tensor?

The main advantage is in domains where you can't fit all of your data into memory. However, I've seen improvements in performance even in cases where I have all my data into memory. I think two reason …
Djib2011's user avatar
  • 8,038
2 votes
Accepted

Keras model.predict giving different shape from training label array

The 10 outputs came from the fact that you have 10 neurons in the final layer of your network. If you change your model to model = tf.keras.models.Sequential([ tf.keras.layers.Dense(10, activation …
Djib2011's user avatar
  • 8,038
1 vote
Accepted

Layer weights don't match in keras

I took the liberty of changing your code a bit to make this a bit more clear. import numpy as np import tensorflow as tf f = lambda x: 2*x Xtrain = np.random.rand(400, 5) # 5 input features ytrain = …
Djib2011's user avatar
  • 8,038
1 vote

Tensorflow with Python code

This uses a tensorflow module called AutoGraph to basically convert your python/numpy operations to tensorflow ops. However not all python operations can be converted. …
Djib2011's user avatar
  • 8,038
0 votes
Accepted

is there a way to customize my loss function to increase recall in one class only?

TensorFlow In TensorFlow you can do this simply by using this softmax_cross_entropy loss instead of the one you are currently using. This supports class weights (weights attribute). …
Djib2011's user avatar
  • 8,038
1 vote

GradientTape not computing gradient

Since you are trying to compute $\partial loss \over \partial x$ you need to perform all operations that lead from $x$ to $loss$ inside GradientTape's scope, so that it can monitor them. x = tf.Varia …
Djib2011's user avatar
  • 8,038
1 vote
Accepted

Scheduler for activation layer parameter using Keras callback

You will need to write a custom callback for this, that implements the on_epoch_end method. Roughly it should look something like this class CustomCallback(keras.callbacks.Callback): def __init__ …
Djib2011's user avatar
  • 8,038
2 votes

Predict_proba for Binary classifier in Tensorflow

If you're referring to scikit-learn's predict_proba, it is equivalent to taking the sigmoid-activated output of the model in tensorflow. In fact that's exactly what scikit-learn does. …
Djib2011's user avatar
  • 8,038
13 votes

Should use sklearn or tensorflow for neural networks?

Among the two, since you are interested in deep learning, pick tensorflow. However, I would suggest going with keras, which uses tensorflow as a backend, but offers an easier interface. …
Djib2011's user avatar
  • 8,038
2 votes

Is it possible to make use of the CPU RAM, if i'm running of of VRAM, in tensorflow?

Some options: Some older tensorflow APIs supported this functionality (e.g. dynamic_rnn - see swap_memory parameter). …
Djib2011's user avatar
  • 8,038
1 vote
Accepted

When does Adam update its weights?

Adam works in the same way as SGD does in this regard, it updates the weights at the end of each iteration, so at the end of an epoch multiple weight updates have been applied. Inherently neither Adam …
Djib2011's user avatar
  • 8,038
5 votes

Train a GAN on "before and after" images of dental surgeries

It's a very specific problem and there's no right or wrong solution. I'll just write what I'd do in your position and hope that it is useful. How many "before and after" images will I need? You …
Djib2011's user avatar
  • 8,038
8 votes

L2 regularization increase the loss rate of the deep learning model

Suppose a neural network with a regular loss function. $$ \sum_{i=1}^N L \left( y_i, \; \hat y_i \right) $$ Here, $y_i$ is label for the $i$-th example, while $\hat y_i$ is the model's prediction fo …
Djib2011's user avatar
  • 8,038
8 votes
Accepted

How to make two parallel convolutional neural networks in Keras?

You essentially need a multi-input model. This can only be done through keras' functional api and can work with the pretrained nets in keras.applications. To create one you can do this: from keras.la …
Djib2011's user avatar
  • 8,038

15 30 50 per page