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
9 views

No activation function in some layers of a neural network

What if I dont 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
13 views

Jetson Nano low CNN inference performance [migrated]

I'm running what I believe is a pretty small CNN on an nVidia Jetson Nano with Jetpack 4.4. nVidia claims the Nano can run a ResNet-50 at 36fps, so I expected my much smaller network to run at 30+ fps ...
1
vote
0answers
95 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
25 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 ...
2
votes
0answers
30 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
43 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
20 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
21 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
30 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: ...
2
votes
0answers
21 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 ...
3
votes
1answer
59 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 ...
3
votes
0answers
29 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: ...
0
votes
1answer
54 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 ...
1
vote
1answer
68 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
44 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
53 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 ...
2
votes
0answers
124 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
25 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
27 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
14 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 ...
3
votes
1answer
45 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
31 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
50 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
19 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 ...
0
votes
0answers
18 views

How to afine the extremity values in regression prediction with Keras?

I made a stack of bidirectional LSTM layers following by Dense layers (with swish activation functions) in order to predict a continuous value between 0 and 2. I compiled the model with ...
0
votes
0answers
38 views

Distinguishing between handwritten compound fraction and subtraction

I am working in a project named "Handwritten Math Evaluation". So what basically happens in this is that there are 11 classes of (0 - 9) and (+, -) each containing 50 clean handwritten ...
1
vote
0answers
37 views

Unable to meet desired mean squared error

I wish to get MSE < 0.5 on test data (https://easyupload.io/zr7xf3) which is 20% of given data chosen randomly. But I am reaching 0.73 using both plain Ridge Regression as well as a neural network ...
2
votes
2answers
233 views

How to tell a neural network that: “your i-th input is special”

Assume that I have a fully connected network that takes in a vector containing 1025 elements. First 1024 elements are related to ...
2
votes
1answer
41 views

Evaluate model multiple times in loss function? Is this reinforcement learning?

I am interested in models that exhibit behavior. My goal is a model that survives indefinitely on a two dimensional resource landscape. One dimension represents the location (0 to 1) and the second ...
2
votes
2answers
182 views

What is the need for so many filters in a CNN?

Consider the following coding line related to CNNS Conv2D(64, (3,3), strides=(2, 2), padding='same') It is a convolution layer with filter size $3 \times 3$ and ...
0
votes
0answers
27 views

Pytorch and keras ddqn seem identical, only keras learns

I followed a tutorial for ddqn to beat pong, it beats it with a perfect score in keras, but trying to translate it to pytorch it doesn't learn at all. What am I missing? I pasted all the code for each ...
0
votes
0answers
30 views

How to make a CNN/RNN on a non-binary dataset?

I am using TensorFlow + Keras to make a CNN/RNN. I'm quite new to AI, I've only made a few relatively basic networks for image regression/classification. The end goal of my project is to determine the ...
0
votes
1answer
26 views

Image Classification for watermarks with poor results

Just starting learning things about tensorflow and NN. As an exercise I decided to create a dataset of images, watermarked and not, in order to binary classify these. First of all, the dataset ( you ...
1
vote
0answers
20 views

Duplicating calculations in CNN-LSTM architecture

I want to use frames from video game and analyze them using CNN and LSTM. But when I have the model defined like that ...
1
vote
1answer
37 views

How to construct input dependent convolutional filter?

I am constructing a convolutional variational autoencoder for images, starting out with mnist digits. Typically I would specify convolutional layers in the following way: ...
0
votes
0answers
13 views

What is the difference between TimeDistributed CNN+RNN and passing sequence of features to RNN

I found Keras API that allows to add additional time dimension. ...
3
votes
1answer
41 views

Generation of 'new log probabilities' in continuous action space PPO

I have a conceptual question for you all that hopefully I can convey clearly. I am building an RL agent in Keras using continuous PPO to control a laser attached to a pan/tilt turret for target ...
0
votes
1answer
44 views

Why does the output shape of a Dense layer contain a batch size?

I understand that the batch size is the number of examples you pass into the neural network (NN). If the batch size is 10, it means you feed the NN 10 examples at once. Assuming I have an NN with a ...
0
votes
0answers
14 views

Why is the variance of my model predictions much smaller than the training data?

I trained a GRU model on some data and then created a bunch of predictions on a test set. The predictions are really bad, as indicated by a near zero R2 score. I notice that the variance of the model ...
1
vote
1answer
32 views

Why is the convolution layer called Conv2D?

When I build a convolution layer for image processing, the filter parameters should have 3 dimensions, (filter_length, filter_width, color_depth) is that correct? ...
1
vote
1answer
51 views

Using DDPG for control in multi-dimensional continuous action space?

I am relatively new to reinforcement learning, and I am trying to implement a reinforcement learning algorithm that can do continuous control in a custom environment. The state of the environment is ...
0
votes
2answers
53 views

Is there a neural network that accepts both the current input and previous output?

I am quite new to neural networks. I am trying to implement in Python a neural network having only one hidden layer with $N$ neurons and $1$ output layer. The point is that I am analyzing time series ...
1
vote
0answers
30 views

Keras model accuracy not improving beyond threshold

I am currently working on a public project for the National Weather Model. We are experimenting with using a recurrent neural network to replace the output of a quadratic formula that is in use. The ...
1
vote
0answers
56 views

What is the best way to make a deep reinforcement learning environment with a continuous 2D action space?

I understand that the actor-critic method is probably where I want to start because of how it works with continuous action spaces. However, the problem I am trying to solve would require the action be ...
0
votes
0answers
48 views

ConvNet - What to improve regarding architecture, procedure and technique?

I have a dataset of 180k images of license plates (so, not necessary to localize the license plate at first) for which I try to recognize the characters on the images (License plate recognition). All ...
1
vote
0answers
50 views

Embedding Layer into Convolution Layer

I'm looking to encode PDF documents for deep learning such that an image representation of the PDF refers to word embeddings instead of graphic data So I've indexed a relatively small vocabulary (88 ...
1
vote
1answer
46 views

When would bias regularisation and activation regularisation be necessary?

For Keras on TensorFlow, a layer class constructor comes with these: kernel_regularizer=... bias_regularizer=... ...
0
votes
0answers
37 views

Micro average f1_score, None average f1_score cannot increase more than 0.71, 0.50 respectively for the best model estimator

I am training a multilabel text neural network and the model metric I chose, to measure the performance of the training and the validation sets, is the f1 score (Micro average, None average). However, ...
0
votes
0answers
41 views

CIFAR-10 can't get above 10% Accuracy with MobileNet, VGG16 and ResNet on Keras

I'm trying to train the most popular Models (mobileNet, VGG16, ResNet...) with the CIFAR10-dataset but the accuracy can't get above 9,9%. I want to do that with the completely model (include_top=True) ...

1
2 3 4 5 6