Questions tagged [python]

For questions related to AI implementation in the Python language

Filter by
Sorted by
Tagged with
16
votes
5answers
31k views

Why does C++ seem less widely used than Python in AI?

I just want to know why do machine learning engineers and AI programmers use languages like Python to perform AI tasks and not C++, even though C++ is technically a more powerful language than Python.
5
votes
2answers
415 views

Why am I getting the incorrect value of lambda?

I am trying to solve for $\lambda$ using temporal-difference learning. More specifically, I am trying to figure out what $\lambda$ I need, such that $\text{TD}(\lambda)=\text{TD}(1)$, after one ...
0
votes
1answer
311 views

Monte-Carlo, every-visit gridworld, exploring starts, python code gets stuck in foreverloop in episode generation

I've been trying to implement policy improvement for Q(s,a) function as per Sutton&Barto reinforcement learning book. The original algorithm with first-visit MonteCarlo is pictured below. I ...
0
votes
0answers
10 views

Train a model using a multi-column text-filled excel sheet

I have an excel sheet filled with my own personal appreciations of movies I've watched, and I want to use it to train an AI model so that it can predict if I'll like a specific movie or not, based on ...
3
votes
1answer
1k views

What is the typical AI approach for solving blackjack?

I'm currently developing a blackjack program. Now, I want to create an AI that essentially uses the mathematics of blackjack to make decisions. So, what is the typical AI approach for solving ...
1
vote
1answer
191 views

What do the values of the leaves of the decision tree represent?

This is more of a technical question rather than a practical one. I've exported a decision tree made with python/scikit learn and would like to know what the "value" field of each leaf corresponds to....
4
votes
1answer
472 views

How to parse conjunctions in natural language processing?

Is there an accepted way in NLP to parse conjunctions (and/or) in a sentence? By following the example below, how would I parse I drink orange juice if its the weekend or if it's late and I'm ...
0
votes
1answer
18 views

What is the difference between exhaustive nearest neighbor search and k-nearest neighbour search?

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

Why is my neural network not able to approximate this function?

I'm trying to approximate the following function with a neural network (in Python). ...
0
votes
0answers
21 views

VAE generates bad images. due to unbalanced loss functions? [closed]

I'm training a variational autoencoder on CelebA dataset using TensorFlow.keras The problem I'm facing is that the generated images are not diverse enough and look kinda bad. example: What I think:...
3
votes
1answer
116 views

How to find the category of a technical text on a surface-semantic-level

There are some predefined categories( Overview, Data Architecture, Technical Details, Applications, etc). The requirement is to classify the input text of paragraphs into their resp. category. I can't ...
4
votes
1answer
96 views

Disentangled VAE doesn't reconstruct accurate grids

I am trying to implement the disentangled VAE model according to this link. I want to understand the architecture of this model in order to customize it later. As infrastructure, I have a Linux kernel ...
2
votes
0answers
102 views

How to select good inputs and fitness function to achive good results with NEAT for Icy Tower bot

I'm trying to make a bot to the famous "Icy Tower" game. I rebuilt the game using pygame and I'm trying to build the bot using Python-NEAT. Every generation a population of 70 characters tries to ...
0
votes
1answer
47 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. ...
33
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
3answers
108 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 ...
5
votes
1answer
176 views

What are the ways to calculate the error rate of a deep Convolutional Neural Network, when the network produces different results using the same data?

I am new to the object recognition community. Here I am asking about the broadly accepted ways to calculate the error rate of a deep CNN when the network produces different results using the same data....
1
vote
0answers
28 views

How can I perform policy update in python? [closed]

I'm using Python and tensorflow to implement a Deep Q-learning with experience replay in a continous action and state spaces and I have used two neural networks to approximate both the policy function ...
0
votes
0answers
9 views

Training a model for text document transformation?

I have a bunch of text documents, split into source documents and transformed documents. These text documents have multiple lines and are edited at specific locations, in a specific way. I make use ...
0
votes
0answers
13 views

How to save and load a Q-Learning Agent [migrated]

I know this may sound nooby, but how do I save a Deep Q-Learning agent's progress? I mean when I close at i.e. episode 500 when my agent is trained and I restart (in my case a pygame) my agent is ...
4
votes
2answers
75 views

Is there an open-source implementation for graph convolution networks for weighted graphs?

Currently, I'm using a Python library, StellarGraph, to implement GCN. And I now have a situation where I have graphs with weighted edges. Unfortunately, StellarGraph doesn't support those graphs I'm ...
0
votes
0answers
10 views

How to set only the modified weights for each convolutional layers? [migrated]

I am currently doing some experiments on modifying the weights and not of the bias for each convolutional layers of a model. For each of the layers of the model, I used ...
0
votes
1answer
101 views

Once the environments are vectorized, how do I have to gather immediate experiences for the agent?

My main purpose right now is to train an agent using the A2C algorithm to solve the Atari Breakout game. So far I have succeeded to create that code with a single agent and environment. To break the ...
2
votes
0answers
87 views

Understanding log probabilities of actions in the PPO objective

I'm trying to implement the Proximal Policy Optimization (PPO) algorithm (code here), but I am confused about certain concepts. What is the correct way to implement log probability of a policy (...
2
votes
2answers
136 views

Advantage computed the wrong way?

Here is the code written by Maxim Lapan. I am reading his book (Deep Reinforcement Learning Hands-on). I have seen a line in his code which is really weird. In the accumulation of the policy gradient $...
0
votes
1answer
841 views

Simple Image Processing AI for Fire Detection

I have absolutely no experience with any kind of AI and really want to create this: A program that can train on a set of images to determine if an image is showing a fire flame or not (for fire ...
0
votes
1answer
27 views

How does the math behind heat map filters work?

I am working on an app that generates heat/ thermal map given a picture. i have been able to get what i expected using python opencv builtin function ...
1
vote
0answers
21 views

What pre-processing of the image is needed before feeding it into the convolutional neural network?

I can't figure out what preprocessing of the image is needed before feeding it into the convolutional neural network. For example, I want to recognize circles on a 1000 by 1000 px photo. The learning ...
0
votes
0answers
11 views

Number of parameters in Resnet-50 [migrated]

I'm using Keras, and I am struggling to know how many parameters Resnet-50 has. Keras documentation says around 25M, while if I ...
2
votes
0answers
49 views

Wooden railway search problem AI

I have this problem. A basic wooden railway set contains the pieces shown in Figure 3.32. The task is to connect these pieces into a railway that has no overlapping tracks and no loose ...
55
votes
10answers
33k views

Why is Python such a popular language in the AI field?

First of all, I'm a beginner studying AI and this is not an opinion-oriented question or one to compare programming languages. I'm not implying that Python is the best language. But the fact is that ...
1
vote
0answers
17 views

An Encoder-Decoder based CNN to predict a tensor of points

So I have with me a data of rendered 2D images of a 3D object and along with that, I have the image projection coordinates (X, Y) of all the voxels that are in the ...
0
votes
1answer
62 views

How to handle extremely 'long' images?

After transforming timeseries into an image format, I get a width-height ratio of ~135. Typical image CNN applications involve either square or reasonably-rectangular proportions - whereas mine look ...
4
votes
1answer
826 views

How do you handle multiple categorical values in a single column for wide_deep model in tensorflow? [closed]

To start, let me just say that I am very new to tensorflow and Machine Learning in general. But, as part of my learning project I am trying to adapt the tensorflow wide and deep model to generate ...
2
votes
1answer
57 views

I created a snake game and fitted the NEAT algorithm and there's issues

Below are my Inputs Outputs and fitness function. The snake is learning at a slow rate, and seems to be stagnant, additionally when the snake collides with the food, it gets deleted from the genome, ...
1
vote
0answers
22 views

How can I write these rules with the AND operator in skfuzzy? [closed]

I have the following three rules If A is medium and B is low then quality is low If A is ...
1
vote
0answers
30 views

How do i start building an autoclick bot for pubg mobile?

I want to make a bot which clicks the fire button on the mobile screen upon seeing an enemies head. In pubg mobile which is an android game you have to control the fire button and the aim along with ...
1
vote
1answer
98 views

How to train a LSTM model with multi dimensional data

I am trying to train my model using LTSM layer in Keras (python). I have some problems regarding the data representation and feeding it into the model. My data is 184 XY coodinates encoded as a numpy ...
1
vote
0answers
124 views

Exploding population size in neat-python

I am trying to make my AI win the board game "Catan" against my friends. Therefore i am using the python implementation of NEAT. As I changed the values of ...
5
votes
3answers
119 views

Is there a Python API for manipulating publicly available datasets? [closed]

In my daily machine learning / deep learning workflow, I often want to interact with a dataset in my code. Specifically, I would like to be able to load some module/package which can make sure that I ...
1
vote
0answers
20 views

Genetic Algorithm Python Snake not improving

So, i have created Snake game using Pygame and Python. Then i wanted to create an AI with Genetic algorithm and a simple NN to play it. Seems pretty fun, but things aren't working out. This is my ...
1
vote
0answers
28 views

Subtracting the entropy from our policy gradient will prevent our agent from being stuck in the local minimum?

In the information theory, the entropy is a measure of uncertainty in some system. Being applied to agent policy, entropy shows how much the agent is uncertain about which action to make. In math ...
1
vote
0answers
143 views

Replace epsilon greedy action selection and the standard DQN by an Independent Gaussian Noise Network Model

Here is my code Recently, I solved the game of Atari Breakout using a classic DQN model. The convergence of the mean reward slowly improved during three days. I was interested in learning a method ...
0
votes
0answers
16 views

What are the best human re-identification methods available?

I have a use case where I need to detect, track and re-identify humans in CCTV footage. I have usedSSD and Median Flow to detect ...
3
votes
6answers
64 views

How can I cluster this data frame with several features and observations?

How can I cluster the data frame below with several features and observations? And how would I go about determining the quality of those clusters? Is k-NN appropriate for this? ...
2
votes
1answer
54 views

In a single neuron output layer should the output be a scalar?

Given a neural network with 3 inputs, 4 hidden layers, and 1 output, should the output neuron be a vector or a scalar? I thought that at the end of the summation only one number between 0 and 1 would ...
1
vote
1answer
25 views

Why are the rewards of my RL agent for the Atari Breakout game decreasing after a certain number of episodes?

The agent is trying to master the Atari Breakout game. Here is my code Is that normal that reward_100 decreased that much after it hits 4.5? Is there a way to ...
3
votes
0answers
52 views

How to perform classification with NEAT-Python?

I am trying to do classification using NEAT-python for the first time, and I am having difficulty getting the accuracy rate. I tried the same problem with an ANN and was able to get a good accuracy ...
1
vote
2answers
93 views

Is a VGG-based CNN model sometimes better for image classfication than a modern architecture?

I have an image classification task to solve, but based on quite simple/good terms: There are only two classes (either good or not good) The images always show the same kind of piece (either with or ...

1
2 3 4 5 6