Questions tagged [python]

For questions related to AI implementation in the Python language

Filter by
Sorted by
Tagged with
1
vote
0answers
7 views

Standardize images using ImageDataGenerator in keras

I was trying to normalize my input data images for feeding to my convolutional neural network and wanted to use standardize my input data. I referred to this article: https://stackoverflow.com/...
0
votes
0answers
24 views

In Python, how to combine 3D arrays into one 4D array? [closed]

I have N arrays of dimension (1080, 1920, 3). I wanna combine them into one array of dimension (N, 1080, 1920, 3). I code it, but not quite satisfied, could you help me?
0
votes
0answers
21 views

Which deep learning framework is highly recommended to get professional in computer vision community?

I have tried to get the basic grasp of the following deep learning frameworks with python: Keras Pytorch Caffe However, I have lately noticed that people in the computer vision community care less ...
0
votes
1answer
20 views

Indexing tensors in custom loss function with Keras

I'm using a custom loss function in Keras. This is the function: ...
0
votes
0answers
17 views

Keras fit generator - ValueError: Failed to find data adapter that can handle input

I'm trying to fit my deep learning model with a custom generator. When i fit the model, it shows me this error: I tried to find similar questions, but all the answers were about converting lists to ...
0
votes
0answers
10 views

Exhaustive Nearest Neighbor Search vs KNN

I have two lists of feature vectors calculated from pre-trained CNN for image retrieval task: Query: FV_Q and Reference FV_R. <...
1
vote
0answers
19 views

Is it possible to convert Neural Network code in Python into Matlab code? [closed]

I want to convert the code written in Python into Matlab code. May I know is it possible to do that. Share the available ways or methods to do the conversion. May I know is there any Online ...
0
votes
0answers
11 views

Keras MLP returns always loss 0.0

I'm implementing a multilayer perceptron with Keras to predict the correct words order in a sentence. I'm using train_on_batch()because I convert each sentence in a ...
2
votes
0answers
17 views

How do I make my LSTM model more sensitive to changes in the sequence?

I have a many to one LSTM model for multiclass classification. For reference, this is the architecture of the model ...
1
vote
0answers
14 views

How to program instructions for outputs in the neat-python module

I've made a snake game in python and I'm trying to make a NEAT ai for it. I've successfully made the game but I'm having trouble implementing the ai. Right now I want to know how to give it ...
1
vote
0answers
18 views

Does this tutorial use normalization the right way?

There is this video on pythonprogramming.net that trains a network on the MNIST handwriting dataset. At ~9:15, the author explains that the data should be normalized. The normalization is done with ...
0
votes
2answers
16 views

Binarize ConvNet Feature vector

Given a pre-trained CNN model, I extract feature vector of 3450 reference images FV_R as follows: ...
0
votes
0answers
17 views

Tensorflow throwing out of bounds error with keras tokenizer

I am new to ML and tensorflow and trying to train and use a standard text generation model. When I go to train the model I get this error: ...
1
vote
0answers
13 views

Predict a value calculated from a hash (and hash before that hash)

I have a hash, e.g. 552c51576e2a6dec462b0d56af8c31713e26a763c0e2a3d48ebbf4b99958eeba. This hash hashed again, is ...
1
vote
0answers
16 views

How to encode 16bits PNG using cv2.imencode() in python?

I want to use cv2.imencode() to encode a 16 bits PNG image.The code in here: The 'depth' and 'data_encode' are as follows: We can find, the type of 'depth' is uint16, but the type of 'data_encode' ...
3
votes
1answer
49 views

How can I generate unique random patterns (similar to the ones in Nutella jars)?

How can I generate unique patterns, as they did for these Nutella jars? See, for example, the video Algorithm designs seven million different jars of Nutella.
1
vote
1answer
29 views

Applying Artificial neural network into kaggle's house prices data set gave bad predicted values

I am trying to solve the kaggle's house prices using neural network. I've already made it with ensembling several models (XGBoost, GradientBooster and Ridge) and I've got a great score ranking me ...
29
votes
6answers
9k views

Why do CNN's sometimes make highly confident mistakes, and how can one combat this problem?

I trained a simple CNN on the MNIST database of handwritten digits to 99% accuracy. I'm feeding in a bunch of handwritten digits, and non-digits from a document. I want the CNN to report errors, so I ...
1
vote
1answer
78 views

How many layers exists in my neural network?

I have a neural network model defined as below. How many layers exist there? Not sure which ones to count when we are asked about the number. ...
0
votes
0answers
29 views

Getting nan values after couple epochs in self built neural network

It is my first time building a neural network from scratch (using only numpy) and I came across this problem. Not only loss, but weights and all outputs become nan after just couple of epochs (around ...
2
votes
0answers
33 views

How can I implement derivative of softmax function for matrices in Python?

I have trouble understanding how to implement derivative of softmax function. Here is what I tried: ...
0
votes
2answers
49 views

Why there's so much search for Python professionals in AI?

Even with ample knowledge about the low computational performance that Python has, and even though it is an interpreted language that is not recommended for real-time applications, it is the ...
1
vote
0answers
15 views

How to build sort objects model using Deep Learning

How to build sort objects model using Deep Learning if i have some objects in an image enter image description here if i give him an similar image he sort the detected order according to Learning ...
2
votes
0answers
24 views

How can I train a Deep Learning model using degraded photos and their clean version to correct photos

I have 5000 degraded pictures ( pixelated, blurry, too much luminosity ... ) and their clean versions, and I would like to train a model so that it can predict how to correct future pictures. I've ...
1
vote
1answer
17 views

Best Camera and protocol for embedded real time CNN project

I'm looking to develop a stand-alone real-time outdoor imaging CNN application, and I can't wrap my head around the myriad of camera options and their communication protocols. The target is a Linux ...
6
votes
2answers
148 views

Can we get the inverse of the function that a neural network represents?

I was wondering if it's possible to get the inverse of a neural network. If we view a NN as a function, can we obtain its inverse? I tried to build a simple MNIST architecture, with the input of (784,...
1
vote
0answers
27 views

Why I got the same action when I train A2C when I increase the number of episodes?

I'm working on an advantage actor-critic (A2C) reinforcement learning model but the problem when I trained the system for 3500 episodes, I start to get the same action for all my testing results. ...
1
vote
1answer
58 views

Interpretation of feature selection based on the model

The description of feature selection based on a random forest uses trees without pruning. Do I need to use tree pruning? The thing is, if I don't cut the trees, the forest will retrain. Below in the ...
1
vote
0answers
50 views

Is it possible to use entity embedding with autoencoder for anomaly detetction?

I'm trying to build autoencoder in keras in order to detect anomalies. However, most of the data is categorical and I have to encode it. When it comes to production, categorical features can take new ...
0
votes
1answer
38 views

not sure if fine-tuned network is finely-tuned

I am practicing with Resnet50 fine tuning for binary classification task, here is my code snippet. ...
1
vote
0answers
24 views

Can anyone explain the pixelwise accuracy metric used in this paper? Also a question to the KL Divergence Loss

So I am making a project based on this paper: https://arxiv.org/ftp/arxiv/papers/1901/1901.07761.pdf In this paper, a U-Net is used to generate optimized mechanical structures. I am trying to ...
1
vote
1answer
60 views

How many parameters are being optimised over in a simple CNN?

Okay so here's my CNN (simple example from a tutorial) along with some arithmetic to get the total number of free parameters. We've got a dataset of 28*28 grayscale image (MNIST). First layer is a ...
1
vote
0answers
38 views

How can I split the data into training and validation sets such that entries with a certain value are kept together?

I have the following kind of data frame. These are just example: A 1 Normal A 2 Normal A 3 Stress B 1 Normal B 2 Stress B 3 Stress C 1 Normal C 2 Normal C 3 Normal ...
2
votes
1answer
40 views

Why does the denoising autoencoder always returns the same output?

I am trying to implement a denoising autoencoder (DAE) to remove noise from 1024-point FFT spectra. I am using two types of spectra: (1) that contain a distinctive high amplitude spectral peak and (2) ...
2
votes
0answers
21 views

Can't figure out what's going wrong with my dataset construction for multivariate regression

TL;DR: I can't figure out why my neural network wont give me a sensible output. I assume it's something to do with how I'm presenting the input data to it but I have no idea how to fix it. Background:...
3
votes
0answers
30 views

Reinforcement Learning on quantum circuit

I am trying to teach an agent to make any random 1-qubit state reach uniform superposition. So basically, the full circuit will be ...
1
vote
1answer
36 views

Deep Learning models train really slow Jetson Nano [closed]

I recently bought a Jetson Nano and I'm amazed with everything about it. But I don't know what is happening, because I created a very simple neural network with keras and it's taking way to long. I ...
1
vote
0answers
40 views

Why isn't this deep Q network agent for the snake game learning?

I wanted to combine this snake game with this DQN implementation I found in this article. First, I tried to change the NN's input layer to a 400 input. The game has a field of 20 times 20, so I ...
3
votes
1answer
143 views

How can I minimise the false positives?

I have 50,000 samples. Of these 23,000 belong to the desired class $A$. I can sacrifice the number of instances that are classified as belonging to the desired class $A$. It will be enough for me to ...
2
votes
1answer
35 views

How to reduce variance of the model loss during training?

I know that stochastic gradient descent always gives different results. What are the best practices to reduce this variance today? I tried to predict simple function with two different approaches and ...
2
votes
0answers
26 views

How would one develop an action space for a game that is proprietary?

I'm currently trying to develop an RL that will teach itself to play the popular fighting game "Tekken 7". I initially had the idea of teaching it to play generally- against actual opponents with ...
2
votes
2answers
87 views

Are there any public real-life code examples of ML applications in Python?

Problems I often face at work usually differ from tutorial or book-like examples so I end up with a code that works but it's not elegant and takes too much time to write. I wanted to ask you if there ...
2
votes
0answers
15 views

Calculation of Neural network biases in backpropagation

While learning neural networks I've found a basic Python working example to play with. It has 3 input nodes, 4 nodes in a hidden layer, 1 output node. 5 data sets for training. The initial code is ...
0
votes
0answers
18 views

Same implementation, but agent is not learning in Retro Pong Environment

I tried to implement the exact same python coding by Andrej Karpathy to train RL agent to play Pong, except that I migrated the environment from Gym to Retro. Everything is the same except the action ...
0
votes
0answers
15 views

Plot class activation heatmap of Caffe Model in Python

Given the following 3 research papers, the authors have shown different heatmap graphical representations for features of the trained CNN models: On the performance of Convnet feature for place ...
3
votes
1answer
57 views

Is there any Python library available for manifold learning using diffusion map?

I would like to use unsupervised learning with a technique called diffusion map based manifold learning in Python. The original paper on the diffusion map is An Introduction to Diffusion Maps. I have ...
2
votes
1answer
81 views

What is the fastest way to train a CNN with billions of examples?

I have a CNN model that I need to train for a large scale genomics application. It is working well with a subset of my training data. I have scaled up to a subset of about 130 million examples and ...
5
votes
1answer
67 views

How do I combine models trained on different data to increase classification accuracy?

I have two trained models. One is using a LinearSVC algorithm and is trained on numerical data from medical examination from patients with diabetic retinopathy. The second one is a neural network ...
4
votes
2answers
36 views

Using a neural network to identify a stable region within a set of data?

I am working on a problem in which I am attempting to find a stable region in a spiral galaxy. The PI I'm working with asked me to use machine learning as a tool to solve the problem. I have created ...
0
votes
0answers
29 views

How could I locate certain words or numbers in a financial statement?

I would like to code a script that could locate a specific word or number in a financial statement. Financial statements roughly contain the same information, they are however not identical and ...

1 2 3 4 5