Questions tagged [keras]

For questions related to Keras, the modular neural networks library written in Python. However, note that programming questions are off-topic here.

Filter by
Sorted by
Tagged with
0
votes
0answers
34 views

What is the role of this initial state of the LSTM layer in an encoder of a seq2seq model?

I am trying to follow this guide to implement a seq2seq machine translation model: https://www.tensorflow.org/tutorials/text/nmt_with_attention. The tutorial's ...
0
votes
0answers
16 views

Which is the Best Way to Create Training Sequences for LSTM-based Class Prediction on Time-series Data?

Let's say I have time-series data in the following way. I need to create training sequences of a fixed length as an input to my LSTM model on PyTorch. ...
0
votes
0answers
10 views

How to write activation function with a higher order tensor in Keras? [migrated]

I want to create a paricular neural network in Keras. In this neural network I use layers given by $$ f(x) = C_k(\underbrace{x,\dots,x)}_{\times k}+\phi(w^\intercal x+b) $$ The expression $\phi(w^\...
1
vote
1answer
41 views

Number of parameters in Keras/Tensorflow Dense layers

I am a bit confused about how the number of parameters are calculated in Dense model for the Kera/Tensorflow. For example, in the figure below I thought that both the statements were the same, but I ...
0
votes
0answers
23 views

Are there any inverse RNN layers?

Given the model: Sequence([ GRU(200, input_shape=(None,100), return_sequences=False) ]) Which maps the space ...
2
votes
1answer
51 views

Is it possible to use an internal layer's outputs in a loss function?

For a network of the form: Input(10) Dense(200) Dense(100+10) Dense(20) Output() Those +10 outputs are what I want to add to ...
1
vote
0answers
28 views

Is a true RNN auto encoder possible with Keras/TF

I want to get some encodings for temporal data (with a highly varying number of timesteps). The dataset is of the format: ...
3
votes
2answers
49 views

Can predictions of a neural network using ReLU activation be non-linear (i.e. follow the pattern) outside of the scope of trained data?

Training on a quadratic function x = np.linspace(-10, 10, num=1000) np.random.shuffle(x) y = x**2 Will predict an expected quadratic curve between ...
0
votes
0answers
17 views

Multi dimensional LSTM modeling in KERAS

I have a database of time series signals with multiple features and Im trying to build a model to predict whether or not two samples are related to each other. For example : a database of 1000 sample ...
0
votes
0answers
12 views

How to predict when a number will occur again, give an array of integers?

I am new to machine learning and AI. I'm trying to create a program that adds a random number (1-5) to an array every 1 second and at a random point stops doing that. If that's the case, then it shall ...
1
vote
2answers
46 views

How can I model any structure for a neural network?

Hello I am currently doing research on the effect of altering a neural network's structure. Particularly I am investigating what affect would putting a random DAG (directed acyclic graph) in the ...
1
vote
1answer
22 views

What is the input to the left most LSTM cell c(t-1) and h(t-1)?

Given an LSTM model with 3 cells shown below, what would be the input to the left most cell c(t-1) and h(t-1)?
2
votes
1answer
43 views

Preparing data set for the YOLO algorithm

Hi I am working on a project which requires the You Only Look Once algorithm in order to classify and localise objects within images. I have to prepare my dataset (which has 2 classes, and predicts 6 ...
0
votes
1answer
29 views

“Porpoising” in latter stages of validation loss and MSE charts in Keras

Performing a prediction of a continuous y target using Keras, the simple structure of the code revolves around; ...
1
vote
1answer
26 views

Does use of GPU reduces time of execution of .predict() method in Keras/TF model? [closed]

Does using GPU instead of CPU with tensorflow and keras model reduces the time of .predict() method on a trained network or maybe it only reduces time of training of the network?
4
votes
0answers
40 views

It is possible to use deep learning to give approximate solutions to NP-hard graph theory problems?

It is possible to use deep learning to give approximate solutions to NP-hard graph theory problems? If we take, for example, the travelling salesman problem (or the dominating set problem). Let's say ...
1
vote
1answer
36 views

Should one use an “other” category in image classification?

In image classification, there are sometimes images that do not fit in any category. For example, if I build a CNN in Keras to classify Dogs and Cats, does it help (in terms of training time and ...
0
votes
0answers
22 views

Compression of real time speech data

I am trying to train 2 neural networks - one to compress and the other to decompress real time speech data, and I have a few questions. First off Would this even work - trained, of course, on the same ...
1
vote
1answer
36 views

How to train a neural network with few weights and biases held constant?

I am a beginner in neural networks. I am building a neural network with 3 layers. The input $X$ has 7 features and the output $Y$ is a real number. In the hidden layer, there are two nodes. The bottom ...
0
votes
1answer
25 views

setting up last layer in tensoflow for class type of label [closed]

I am creating a NN in tensorflow keras. the inputs are all float and the output is a class. The output currently encoded as a float, but only has 4 values (0,1,2,3). My model is similar to this: ...
0
votes
0answers
53 views

Is it possible to transform audio with neural networks to make it sound like 3d sound

so the idea is to feed neural network data like input: mono audio(extracted from existing 3d audio) output: 3d audio after training it should convert mono audio to 3d sound do you think it is possible?...
1
vote
0answers
30 views

Does the order of data augmentation and normalization matter?

What is the preferred order of data augmentation and normalization? Is it the former followed by the latter?
0
votes
0answers
80 views

How to make an ensemble model of two LSTM models with different window sizes i.e. different data shapes

Below is the Python code for making an ensemble model. All the inputs are the same for all three models. But what if the models have different input shapes due to different window size, such as LSTM ...
2
votes
0answers
32 views

Single-value loss/training in a CNN with a tensor output

I am playing around with an idea of using using Q-learning with a DQN (Deep Q-Network), to determine the optimal position of a number of 'units' on a grid of allowed locations, according to some ...
0
votes
0answers
30 views

Yolo from scratch dataset and output

Hi I coded a YOLO model from scratch and just came to realise that my dataset does not fit the models output. This is what I mean: The model outputs a ...
1
vote
1answer
32 views

Keras 1D CNN always predicts the same result even if accuracy is high on training set

The validation accuracy of my 1D CNN is stuck on 0.5 and that's because I'm always getting the same prediction out of a balanced data set. At the same time my training accuracy keeps increasing and ...
1
vote
1answer
51 views

What happens if there is no activation function in some layers of a neural network?

What if I don't apply an activation function on some layers in a neural network. How will it affect the model? Take for instance the following code snippet: ...
0
votes
0answers
107 views

How the parameters of decay_rate & decay_steps are taken into consideration while computing InverseTimeDecay()

During the last couple of days, I am experimenting with the different schedulers of learning rate decay offered by Keras (link here). Specifically, I have been using InverseTimeDecay: A ...
3
votes
0answers
30 views

Validation accuracy higher than training accurarcy

I implemented the unet in tensorflow for the segmentation of MRI images of the thigh. I noticed I always get a higher validation accuracy by a small gap, independently of the initial split. One ...
1
vote
0answers
32 views

Can I constrain my neurons in a neural network in according to the orders of the input?

I'm working with data that is ranked. So the inputs are 1,2,3 etc. This means the smaller numbers (ranks) are preferred to the larger ones. Hence the order is important. I want to estimate a number ...
1
vote
0answers
71 views

How to deal with KerasRL DDPG algorithm getting stuck in a local optima?

I am using KerasRL DDPG to try to learn a policy on my own custom environment, but the agent is stuck in a local optima although I am adding the OrnsteinUhlenbeck randomization process. I used the ...
0
votes
0answers
21 views

Network structure of generative model for classification

I'm trying to model a generative model for classification problem, especially aiming to solve an imbalanced data problem. However, I couldn't get intuitive understanding for generative classifier in ...
2
votes
0answers
22 views

Why does the loss stops reducing after a point in this Transformer Model?

Context I was making a Transformer Model to convert English Sentences to German Sentences. But the loss stops reducing after some time. Code ...
4
votes
1answer
41 views

How to graphically represent a RNN architecture implemented in Keras?

I'm trying to create a simple blogpost on RNNs, that should give a better insight into how they work in Keras. Let's say: ...
0
votes
0answers
37 views

CNN for a DQN agent with a 2D matrix state and action as a 2D matrix

I have a custom environment, where the state is a 2D matrix of 11 rows (equals to number of users to satisfy) and 3 columns. Each column can take the value of either 0 or 1, and in each row, there can ...
1
vote
1answer
116 views

How to build a DQN agent with state and action being arrays?

I have a Reinforcement-Learning environment where the state is an array of 0s and 1s with length equals to the number of users the agent must satisfy (11 users). The agent must choose one of 12 ...
1
vote
0answers
65 views

DQN Agent with a 2D matrix as input in Keras

I have a Reinforcement Learning environment where the state is a 2D matrix with 0s and 1s (only one column with the value of 1 in each row). Example: ...
1
vote
1answer
80 views

Advantage Actor Critic model implementation with Tensorflowjs

I am trying to implement an Actor Critic method that controls an RC car. For this I have implemented a simulated environment and actor critic tensorflowjs models. My intention is to train a model to ...
2
votes
1answer
386 views

The truth value of an array with more than one element is ambiguous - Loading a model saved in h5 format keras 2.2.4 [closed]

I'm having a problem when loading a model in keras: model = load_model('model.h5', custom_objects={'mean_iou': metrics.mean_iou}) As an error I get: ...
1
vote
1answer
52 views

Autoencoder: predictions missing for nodes in the bottleneck layer

I'm using tf.Keras to build a deep-fully connected autoencoder. My input dataset is a dataframe with shape (19947,), and the purpose of the autoencoder is to predict normalized gene expression values. ...
1
vote
2answers
68 views

Why is my Keras prediction always close to 100% for one image class?

I am using Keras (on top of TF 2.3) to train an image classifier. In some cases I have more than two classes, but often there are just two classes (either "good" or "bad"). I am ...
0
votes
0answers
126 views

How should I build this DQN agent?

I have a set of users that can be one of 3 types. They will randomly request a service from the UAV which is a drone used as a Base Station. The UAV (the agent) is tasked with allocating subchannels (...
2
votes
0answers
28 views

Loss function decays linearly in segmentation MRI fascia

I am working on a segmentation of MRI images of the thigh. I am trying to segment the fascia, there is a slight imbalance between the background and the mask. I have about 1400 images from 30 patients ...
1
vote
1answer
28 views

Why do we need to provide false labels to the discriminator on purpose to train GANs?

This is the tutorial that I used to learn about GANs. In this tutorial, it taught us to intentionally provide false labels to "fool" the discriminator, but does it make the discriminator ...
0
votes
0answers
15 views

Python Create Keras Neural Network with Bag Of Words Model for News Classification

I want to train a classification neural network then predict some inputs. It's classic classification example as you know. I'm implementing this with python. I searched a lot about it and I always ...
1
vote
1answer
75 views

DQN layers when state space and action space are multi dimensional

I have built my own RL environment, where a state is composed of two elements: the agent's position and a matrix of 0s and 1s (1 if a user has requested a service from the agent, 0 otherwise); an ...
0
votes
1answer
35 views

Extract Features at Multiple Image-Scales

I try to replicate the results of this paper. They state, that they used VGG16- and VGG19-models pretrained on imagenet and used the output of the last convolutional layer (without relu and max-...
1
vote
0answers
60 views

How to design my Neural Network for Game AI

For my school project, I have to develop an agent to play my game. The base I have is a 'GameManager' which call 2 AIs, each taking a random move to do. To make my AI perform, I decided to make a ...
0
votes
0answers
21 views

Relative Weighting of Loss Weights for Self-Play Reinforcement Learning

I am training some self play reinforcement learning agents to play 2 player board games like Connect 4, Othello, and The Game of the Amazons. For each game, there is a single neural network with 2 ...
0
votes
0answers
15 views

How would named recognition and entity linking interface with subsequent machine learning model?

I have a database containing summary of the movie, the price of the movie, location, language. I would like to make a prediction on 'like' based on previous like of a user. I am wonder how the output ...

1
2 3 4 5 6