Questions tagged [tensorflow]

A Python library for deep learning developed by Google. Use this tag for any on-topic question that (a) involves tensorflow either as a critical part of the question or expected answer, & (b) is not just about how to use tensorflow.

225 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
1answer
2k views

Parameters Grid Search for Keras LSTM on Time Series

How do you do grid search for Keras LSTM on time series? I have seen various possible solutions, some recommend to do it manually with for loops, some say to use scikit-learn GridSearchCV. Feedback ...
1
vote
1answer
638 views

Generative Adversarial Network, discriminator loss becomes NAN at the same iteration even in different settings

I am training a GAN model, and I am having a hard time fixing a NAN loss problem for my discriminator. Specifically, my discriminator's loss becomes NAN at the exact same iteration even with different ...
0
votes
0answers
36 views

Compute hinge loss just for the positive class in tensorflow

How to implement hinge loss only for positive class in Tensorflow? I have binary classification task so the output is one-hot encoding of the label. So given out (Tensor of shape (batch_size,2)) and ...
0
votes
0answers
8 views

Why is Conv2D working better than Conv3D if more information is given?

I have time series data, yet it is not 1D but 3D (2D maps of different variables (wind, temperature,...)). Thus, my data is overall of 4D (timestep, latitude, longitude, variables). I want to ...
0
votes
0answers
11 views

accuracy vs val_accuracy in tensorflow

I'm a newbie in DL/ML. What is accuracy and val_accuracy in model.fit() in tensorFlow.keras. How that accuracy and val_accuracy ...
0
votes
1answer
84 views

TF Keras ValueError: Shapes (None, 3, 3) and (None, 3) are incompatible

When running my LSTM model, in which I want to take an input (x,y) and output a sequence [(x1,y1), (x2, y2)..., (x,y)] I get a ...
0
votes
0answers
17 views

Using an RNN to generate a sequence with a static end point using TF and Keras

I'm currently learning about how to use neural networks while working on a project of mine. In the project I'm attempting to have a neural network create a path from a starting point (0,0) to an end ...
0
votes
0answers
1 view

Custom Tensorflow v2.x Optimizer with Sparse update support

I am trying to contribute to tensorflow v2. I am done with _resource_apply_dense but i am struggling with _resource_apply_sparse. There are multiple ways to handle but there is no proper discussion ...
0
votes
0answers
12 views

Is there multiple Basic-RNN cells in a single layer?And is it different from Bidirectional RNN?

Recently, I read a book which describe : if there are two Basic-RNN cells in a single layer, each cell will take hidden states from the other one as input. like this picture: The hidden state of ...
0
votes
0answers
6 views

How to OCR string of known format but variable scale and rotation?

I am trying to build my own OCR for reading serial numbers from package photos, that people will upload to the web page. Preferably based on TensorFlow + Keras, as my poor experience is with these ...
0
votes
0answers
13 views

Re-training deep learning models multiple times to be able to compare their performance?

Let us say I have two deep learning models that differ in their hyperparameters and I want to compare their performance to each other (in terms of acc/ROC for example). However, a single value from ...
0
votes
0answers
18 views

Test scores are way lower than cross-validation scores

I split my Dataset with 80% of the data for training and 20% for the test in the context of a binary classification task with a very unbalanced dataset. On the training set I do a 3 folds ...
0
votes
0answers
16 views

Arbitrary threshold for sigmoid activation function for CNN binary classification?

I am classifying sentiment of reviews - 0 or 1 - using gensim Doc2Vec and CNN in ...
0
votes
0answers
10 views

Regression problem with a recursive equation, prediction of a parameter

Hello I would like to predict the parameter "alpha" from the recursive equation: y(j,k+1) = y(j,k) * alpha(j,0)+ x(j,k). Where j is the loop parameter ...
0
votes
0answers
14 views

How to use multiple inputs into a single output properly

I am building a Reddit post to upvotes predictor based on title, desc and post age and I’m wondering how to design a model with multiple inputs properly, this is a schema I have, what do you guys ...
0
votes
1answer
24 views

What is the difference when importing tf.keras between Tensorflow 1.14 and Tensorflow 2.0?

I have trained a Deep Learning model with tf.keras. In particular, based on an open-source, I have customized my training data and tried to solve a Semantic ...
0
votes
0answers
17 views

Is there a way to find the most adapted NN?

I'm trying to build a NN that uses one or two time series to predict the value of another one, using history. For example, in the next graph : Blue is the input Orange is the predicted output Green ...
0
votes
0answers
15 views

Training an LSTM on multiple distinct batches of time series data

I am running a time series simulation on an electricity power grid simulation package and I want to use this data to train an LSTM to predict the stability of the grid over a given time interval. My ...
0
votes
0answers
26 views

Most efficient way to apply many 2d convolutions

I have two $4$ dimensional tensors, where the first two indices correspond to some fixed values in my problem, and the last two specify a 2D distribution. For each fixed value of the first two indices,...
0
votes
0answers
15 views

How to understand the dilated conv1d layers dimensions in this model?

I was trying to see the layers used in a Wavenet model for speech generation and I can't seem to make sense of the output layers printed by the TF model. Model is this: https://github.com/Rayhane-...
0
votes
0answers
30 views

Approximating a distribution of functions instead of a single function?

It is easy for a neural network to learn to approximate an analytic function such as f(x) = x^2 or f(x) = x^2 + 1. I am ...
0
votes
0answers
5 views

Validation Error less than training error? custom metrics affected from droputs?

I have a neuronal network trained on some data. My testing loss is less than my training loss. As this question is well answered regarding some points here I ask myself, if a custom metric that is ...
0
votes
0answers
55 views

Validation loss diverging when training a simple CNN for text classification

I'm training a CNN for text classification on the IMDb movie reviews dataset. The dataset contains 25000 training and 25000 testing samples of movie reviews, each half positive and half negative. The ...
0
votes
0answers
18 views

Should the lambda for L1 norm regularizer inversely be proportional to the number of trainable weights?

Say I want to implement Conv2D in keras and for each Conv2D layer, if I apply 20 filters of [2,3] filter on an input with depth of 10, then there will be 20*(2*3*10+1) = 1220 trainable weights. the ...
0
votes
0answers
10 views

How to improve neural network training against a large data set of points with varying magnitude

I am currently using TensorFlow and have simply been trying to train a neural network directly against a large continuous data set, e.g. $y = [0.014, 1.545, 10.232, 0.948, ...]$. The loss function in ...
0
votes
1answer
24 views

Finding patterns in binary files using deep learning

I am a newbie in deep learning and wanted to know if the problem I have at hand is a suitable fit for deep learning algorithms. I have thousands of fragments each of about 1000 bytes size (i.e. ...
0
votes
0answers
24 views

How do I apply Min Max scaling for numerical forecast when both dependent and independent volumes are increasing over time?

I'm want to build a numerical regression to forecast. From my initial analysis, it shows linear models (glm) out performs the typical decision tree models (xgboost, ranger...etc). I hypothesized that ...
0
votes
0answers
6 views

Where the embeddings should be implemented in the RNN model?

Hi All (it's my first question here so welcome everyone), I wrote simple RNN model in tensor flow and I cannot figure out where the embeddings should be inserted inside, please find my code and below ...
0
votes
1answer
27 views

Building a neural network with two training paths in Keras

I am trying to build a NN in Keras with two different output paths where the first path informs the second. The first path passes its loss to the end of the second path, like so: Pass through layer A ...
0
votes
0answers
38 views

3D image segmentation: 2D slice-wise vs full 3D model?

I need to segment a volume of $N\times N \times N$ pixels. I can do it in two ways, using a fully 3D convolutional neural network (e.g.: Conv3D in Keras), or I can segment $N$ 2D slices (e.g. Conv2D) ...
0
votes
0answers
13 views

Handling missing target values in vector regression problem with Keras

I'm doing a vector regression problem and many of the target vectors have a few components which are missing (so these components are recorded as nans in the ...
0
votes
0answers
24 views

Use transfer learning with subclassing api of tensorflow keras

I am able to use transfer learning with sequential and functional api but I want to use ResNet50 from tf.keras.applications with subclassing model api of tf.keras. Is this possible? If yes, Can anyone ...
0
votes
0answers
9 views

One step prediction of time series using LSTM

I want to predict stock prices using LSTM. I have successfully trained my model and have it saved. Now that I've loaded it back in, how would I use model.predict() ...
0
votes
0answers
25 views

Gradient Boosting and neural networks

Is there any Python package that implements a boosted neural network ? Any pointer is appreciated. A sample reference about the boosting and NN can be this one.
0
votes
0answers
21 views

Autodiff implementation for policy gradient methods (reinforcement learning)

Maybe this is better posted on stackoverflow, but I thought I would start here . I am trying to understand how RL policy gradient style algorithms are implemented in autodiff frameworks like ...
0
votes
0answers
35 views

tensorflow high validation acuraccy but bad predictions

I asked this over at stackoverflow but this seems to be the specific place to ask machine learning questions so hopefully I can get more answers. Anyways I am trying to make a multiclassed multilabel ...
0
votes
0answers
12 views

LSTM for non-timeseries data - Input Shape

I am dealing with a non-time series problem. I have a total of 20 features. 19 for input and 1 for output I have my input as follows: ...
0
votes
0answers
14 views

Regression with CNN Loss won't pass certain values

I'm working on a regression problem which since my dataset is images i prefered to use widely used CNNs.In general,i have to predict a single value between 0 and 500 for a 100x100 grid based on the ...
0
votes
0answers
24 views

Tacking out of vocab words in neural machine translation with fasttext

I am trying to tackle out of vocab words in my machine translation model build using Tensorflow's official implementation of NMT . I am very much confused how to do it since I am new to NLP. I tried ...
0
votes
0answers
52 views

CNN Mask - IoU Versus Keras “Accuracy”

I am using Keras/Tensorflow to do an FPN CNN model for basic binary mask detection, and have the trainer set to track the metrics of 'IoU' and and the built-in default Keras 'accuracy' metric. IoU is ...
0
votes
0answers
32 views

Is tensorflow LKJ distribution correct?

I am trying to verify that this distribution is propoprtional to a power of the determinant of the matrix: https://www.tensorflow.org/probability/api_docs/python/tfp/distributions/CholeskyLKJ Which ...
0
votes
0answers
7 views

How to train model with custom train/test split ratio?

what i mean train/split ratio is that i've very few images to train model on so is it possible to allocate 100% images to train split and ignore test split entirely? link to project here https://...
0
votes
0answers
13 views

Predictions all coming out the same

Sorry for this basic question, I'm a total noob. I have input data in the format of 6000 x 3 x 256, that is 6000 rows with 3 features, which themselves contain 256 ...
0
votes
0answers
8 views

Weird validation model loss with a stable accuracy

I've trained a CNN based model for activity recognition. The model's validation loss is spiking as seen in the image below What is strange is that the accuracy of my model's validation remains ...
0
votes
0answers
85 views

Reconstruction Loss in Keras with custom loss function

Using Tensorflow 2: My model has an input RGB image of shape (64, 64, 3) and outputs a RGB image of the same shape. I want to use a custom reconstruction loss, therefore I write my loss function to ...
0
votes
0answers
18 views

Over fitting RNN model

I have written a GRU model in order to predict power output. I have noticed though that after 5-6 epochs my val_loss starts to increase and doesn't stop after each epoch and it overfits pretty bad. I ...
0
votes
0answers
10 views

Normalize new inputs

So far in my data I only have percentages (0-1) values, but I want to introduce a new feature with different values. I know, I should use normalization (min-max) Let's say I have [23, 54, 0, 79, 100] ...
0
votes
0answers
29 views

How to train LSTM model with multiple time series?

Hello I'm trying to predic the ETA(estimated arrival time) of airplanes, for that propouse I have data from 996 planes, and all messages collected from ADS-B recivers. Each plane has diferent time ...
0
votes
0answers
39 views

weight visualization of 3d convolutional kernel

I am using 3d kernel of size 3x3x3 for the convolution layer and would like to plot the weights of the layer. Since plotting in 3d is not possible I tried to split the kernels into 3 3×3 for plotting....
0
votes
0answers
37 views

Understanding the result of Maximum Likelihood calculation in OpenAI exersice1-1

This is a TensorFlow code to calculate Maximum log-likelihood from this link. ...