Search Results
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 |
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.
21
votes
Accepted
What is one hot encoding in tensorflow?
Suppose you have a categorical feature in your dataset (e.g. color). And your samples can be either red, yellow or blue. In order to pass this argument to a ML algorithm, you first need to encode it s …
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. …
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 …
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 …
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 …
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 …
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 …
3
votes
How to pass features extracted using CNN into RNN?
1 and 2. You are in the right direction, you need to extract the features using a CNN, then instead of predicting the class you want to reshape the last layer of features and feed it directly into the …
3
votes
Accepted
How to merge two CNN deep learning model using weighted sum and weighted product in Keras?
Example
from keras.layers import Layer, Input, Dense
from keras.models import Model
import keras.backend as K
import tensorflow as tf
# Define the custom layer
class WeightedSum(Layer):
def __init …
2
votes
Accepted
"concat" mode can only merge layers with matching output shapes except for the concat axis
First of all, you are correct that your code is old as some functions being used are deprecated (e.g. Convolution2D is now Conv2D see here).
However, the error clearly states that you are trying to c …
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 …
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). …
2
votes
Accepted
How to train a neural network on multiple objectives?
What you're referring to is called multi-task learning, where your goal is to have a single network learn multiple tasks (in your case "click" and "purchase").
The benefit of having a single model lea …
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. …
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 = …