Questions tagged [tensorflow]

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.

Filter by
Sorted by
Tagged with
125
votes
5answers
146k views

The cross-entropy error function in neural networks

In the MNIST For ML Beginners they define cross-entropy as $$H_{y'} (y) := - \sum_{i} y_{i}' \log (y_i)$$ $y_i$ is the predicted probability value for class $i$ and $y_i'$ is the true probability ...
55
votes
5answers
48k views

Neural networks: which cost function to use?

I am using TensorFlow for experiments mainly with neural networks. Although I have done quite some experiments (XOR-Problem, MNIST, some Regression stuff, ...) now, I struggle with choosing the "...
37
votes
3answers
45k views

Multi GPU in keras

How we can program in the keras library (or tensorflow) to partition training on multiple GPUs? Let's say that you are in an Amazon ec2 instance that has 8 GPU's and you would like to use all of them ...
34
votes
4answers
23k views

Intuitive explanation of Noise Contrastive Estimation (NCE) loss?

I read about NCE (a form of candidate sampling) from these two sources: Tensorflow writeup Original Paper Can someone help me with the following: A simple explanation of how NCE works (I found the ...
31
votes
2answers
38k views

Merging two different models in Keras

I am trying to merge two Keras models into a single model and I am unable to accomplish this. For example in the attached Figure, I would like to fetch the middle layer $A2$ of dimension 8, and use ...
26
votes
1answer
9k views

PyTorch vs. Tensorflow Fold

Both PyTorch and Tensorflow Fold are deep learning frameworks meant to deal with situations where the input data has non-uniform length or dimensions (that is, situations where dynamic graphs are ...
24
votes
3answers
35k views

Neural Network for Multiple Output Regression

I have a dataset containing 34 input columns and 8 output columns. One way to solve the problem is to take the 34 inputs and build individual regression model for each output column. I am wondering ...
23
votes
3answers
43k views

What is weight and bias in deep learning?

I'm starting to learn Machine learning from Tensorflow website. I have developed a very very rudimentary understanding of the flow a deep learning program follows (this method makes me learn fast ...
22
votes
4answers
34k views

Using TensorFlow with Intel GPU

I am a newbie in deep learning. Is there any way now to use TensorFlow with Intel GPUs? If yes, please point me in the right direction. If not, please let me know which framework, if any, (Keras, ...
21
votes
2answers
8k views

Keras vs. tf.keras

I'm a bit confused in choosing between Keras (keras-team/keras) and tf.keras (tensorflow/tensorflow/python/keras/) for my new research project. There is a debate that Keras isn't owned by anyone, so ...
21
votes
2answers
25k views

How to deal with string labels in multi-class classification with keras?

I am newbie on machine learning and keras and now working a multi-class image classification problem using keras. The input is tagged image. After some pre-processing, the training data is represented ...
20
votes
3answers
20k views

Keyword/phrase extraction from Text using Deep Learning libraries

Perhaps this is too broad, but I am looking for references on how to use deep learning in a text summarization task. I have already implemented text summarization using standard word-frequency ...
20
votes
4answers
15k views

What is the meaning of “The number of units in the LSTM cell”?

From Tensorflow code: Tensorflow. RnnCell. num_units: int, The number of units in the LSTM cell. I can't understand what this means. What are the units of LSTM ...
20
votes
2answers
10k views

Choosing between TensorFlow or Theano as backend for Keras

Keras supports both TensorFlow and Theano as backend: what are the pros/cons of choosing one versus the other, besides the fact that currently not all operations are implemented with the TensorFlow ...
19
votes
4answers
11k views

What is the benefit of splitting tfrecord file into shards?

I'm working on speech recognition with Tensorflow and plan to train LSTM NN with massive waves dataset. Because of the performance gains, I plan to use tfrecords. There are several examples on ...
17
votes
3answers
13k views

How to calculate the mini-batch memory impact when training deep learning models?

I'm trying to calculate the amount of memory needed by a GPU to train my model based on this notes from Andrej Karphaty: http://cs231n.github.io/convolutional-networks/#computational-considerations ...
15
votes
5answers
529 views

What more does TensorFlow offer to keras?

I'm aware that keras serves as a high-level interface to TensorFlow. But it seems to me that keras can do many functionalities on its own (data input, model creation, training, evaluation). ...
14
votes
3answers
22k views

How to use LeakyRelu as activation function in sequence DNN in keras?When it perfoms better than Relu?

How do you use LeakyRelu as an activation function in sequence DNN in keras? If I want to write something similar to: ...
14
votes
1answer
3k views

How to add non-image features along side images as the input of CNNs

I'm training a convolutional neural network to classify images on fog conditions (3 classes). However, for each of about 150.000 images I also have four meteorological variables available that might ...
14
votes
1answer
3k views

PyTorch vs. Tensorflow eager

Google recently included in tensorflow's nightly builds its Eager mode, an imperative API to access tensorflow computation capabilities. How do tensorflow eager compare to PyTorch? Some aspects that ...
12
votes
1answer
24k views

How to define a custom performance metric in Keras?

I tried to define a custom metric fuction (F1-Score) in Keras (Tensorflow backend) according to the following: ...
12
votes
4answers
13k views

Detecting anomalies with neural network

I have a large multi dimensional dataset that is generated each day. What would be a good approach to detect any kind of 'anomaly' as compared with previous days? Is this a suitable problem that ...
12
votes
3answers
12k views

Tensorflow Adjusting Cost Function for Imbalanced Data

I have a classification problem with highly imbalanced data. I have read that over and undersampling as well as changing the cost for underrepresented categorical outputs will lead to better fitting. ...
11
votes
7answers
4k views

Why does Keras need TensorFlow as backend?

Why does Keras need the TensorFlow engine? I am not getting correct directions on why we need Keras. We can use TensorFlow to build a neural network model, but why do most people use Keras with ...
11
votes
2answers
14k views

What is one hot encoding in tensorflow?

I am currently doing a course in tensorflow in which they used tf.one_hot(indices, depth). Now I don't understand how these indices change into that binary sequence. Can somebody please explain to ...
11
votes
1answer
13k views

Tensorflow neural network TypeError: Fetch argument has invalid type

I am making a simple neural network using tensorflow, with data I collected myself, however, it's not cooperating :P I have run into an error that I can't fix or find the fix for and I would love your ...
11
votes
3answers
5k views

How does tensor product/multiplication work in TensorFlow?

In Tensorflow, I saw the following example: ...
11
votes
1answer
16k views

Make Keras run on multi-machine multi-core cpu system

I'm working on Seq2Seq model using LSTM from Keras (using Theano background) and I would like to parallelize the processes, because even few MBs of data need several hours for training. It is clear ...
11
votes
1answer
5k views

Train on batches in Tensorflow

I'm currently trying to train a model on a large csv file (>70GB with more than 60 million rows). To do so I'm using tf.contrib.learn.read_batch_examples. I'm struggling in understanding how this ...
10
votes
3answers
5k views

What is the relationship between the accuracy and the loss in deep learning?

I have created three different models using deep learning for multi-class classification and each model gave me a different accuracy and loss value. The results of the testing model as the following: ...
10
votes
3answers
18k views

How to do batch inner product in Tensorflow?

I have two tensor a:[batch_size, dim] b:[batch_size, dim]. I want to do inner product for every pair in the batch, generating <...
10
votes
1answer
2k views

Why TensorFlow can't fit simple linear model if I am minimizing absolute mean error instead of the mean squared error?

In Introduction I have just changed loss = tf.reduce_mean(tf.square(y - y_data)) to ...
10
votes
1answer
20k views

How to make my Neural Netwok run on GPU instead of CPU

I have installed Anaconda3 and have installed latest versions of Keras and Tensorflow. Running this command : ...
10
votes
4answers
8k views

How to get sentence embedding using BERT?

How to get sentence embedding using BERT? ...
10
votes
2answers
5k views

Trying to use TensorFlow to predict financial time series data

I'm new to ML and TensorFlow (I started about a few hours ago), and I'm trying to use it to predict the next few data points in a time series. I'm taking my input and doing this with it: ...
9
votes
2answers
8k views

Why is learning rate causing my neural network's weights to skyrocket?

I am using tensorflow to write simple neural networks for a bit of research and I have had many problems with 'nan' weights while training. I tried many different solutions like changing the optimizer,...
9
votes
1answer
5k views

How to use Embedding() with 3D tensor in Keras?

I have a list of stock price sequences with 20 timesteps each. That's a 2D array of shape (total_seq, 20). I can reshape it into (total_seq, 20, 1) for concatenation to other features. I also have ...
9
votes
2answers
6k views

K-fold cross validation when using fit_generator and flow_from_directory() in Keras

I am using flow_from_directory() and fit_generator in my deep learning model, and I want to use cross validation method to train ...
9
votes
1answer
519 views

Why does my Keras model learn to recognize the background?

I'm trying to train this Keras implementation of Deeplabv3+ on Pascal VOC2012, using the pretrained model (which was also trained on that dataset). I got weird results with the accuracy quickly ...
8
votes
2answers
26k views

Custom loss function with additional parameter in Keras

I'm looking for a way to create a loss function that looks like this: The function should then maximize for the reward. Is this possible to achieve in Keras? Any suggestions how this can be achieved ...
8
votes
1answer
8k views

How to disable GPU with TensorFlow?

Using tensorflow-gpu 2.0.0rc0. I want to choose whether it uses the GPU or the CPU.
8
votes
3answers
4k views

Difference between indicator column and categorical identity column in tensorflow

I am learning Tensorflow and came across different feature columns used in Tensorflow . Out of these types, two are categorical_identity_column and ...
8
votes
2answers
9k views

Clustering high dimensional data

TL;DR: Given a big image dataset (around 36 GiB of raw pixels) of unlabeled data, how can I cluster the images (based on the pixel values) without knowing the number of clusters ...
8
votes
2answers
9k views
8
votes
3answers
54k views

Switching Keras backend Tensorflow to GPU

I use Keras-Tensorflow combo installed with CPU option (it was said to be more robust), but now I'd like to try it with GPU-version. Is there a convenient way to switch? Or shall I re-install fully ...
8
votes
1answer
6k views

Optimizer for Convolutional neural network

What is the best optimizer for Convolutional neural network (CNN)? Can I use RMSProp for CNN or only for RNN?
8
votes
1answer
4k views

What is a tower?

In many tensorflow tutorials (example) "towers" are mentioned without a definition. What is meant by that?
8
votes
2answers
6k views

How can I find out what class each of the columns in the probabilities output correspond to using Keras for a multi-class classification problem?

I'm using transfer learning to build an image recognition model using a pre-trained VGG network in Keras and excluding the final fully-connected layer to get the output weights. I'm then using these ...
8
votes
1answer
349 views

Train a GAN on “before and after” images of dental surgeries [closed]

I want a GAN to train on "before and after" images of dental surgeries; so that it can generate "after" pictures for fresh patients. Input images are like these: https://img.webmd.com/dtmcms/live/...
8
votes
1answer
1k views

Machine Learning: Writing Poems

I'm a student of machine learning, and these days I was trying to learn how to use the TensorFlow library. I've gone through various tutorials and trial&errors with tensorflow, and I thought the ...

1
2 3 4 5
29