Questions tagged [python]

For questions related to AI implementation in the Python language

Filter by
Sorted by
Tagged with
-1
votes
0answers
17 views

How can I apply image segmentation techniques in Python3.9? [closed]

I am working on an image processing and I want to implement these algorithms (techniques) When implementing K means, the output was good, but in the rest of the techniques the output was identical to ...
0
votes
0answers
7 views

Is this the correct method for how to implement a stratified K fold with grid search SVC?

I'm writing a support vector classifier for a binary class using some toy data. This is the code: ...
2
votes
1answer
290 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 ...
0
votes
1answer
18 views

Why does validation accuracy stop rising so soon?

I have implemented a GRU to deal with youtube comment data. I am a bit confused about why the validation score seems to even out around 70% and then keeps rising, this doesn't look like overfitting ...
1
vote
0answers
42 views

The results changed even though seed is fixed [closed]

I am using a reinforcement learning model for some tasks. and for the model, I am using stable_baselin3 and for the environment, I am using the gym. I made a small change in the environment and the ...
0
votes
0answers
46 views

Python libraries for solving reinforcement learning problems implemented in OpenAI gym [closed]

I have implemented a reinforcement problem with Open AI gym in Python and I would like to solve it using different algorithms like Deep-Q-Learning and SARSA (any maybe others). My question is which ...
0
votes
1answer
208 views

Wind speed forecasting using ARIMA model in Python3 [closed]

Recently, I started working on time-series models and would mention that I am very new to python and ML as a whole. I tried to implement a time-series model on wind speed data. Being a newbie, I ...
0
votes
1answer
74 views

How to retrain a Facenet model with the triplet loss function?

I want to calculate the similarity or distance of two faces. I'm using Python. I have read and done what this tutorial says. However, the result is not good (the similarity of same faces and ...
0
votes
1answer
614 views

Problem over DQN Algorithm not converging on snake

I'm using a DQN Algorithm to play Snake. The input of the neural network is a stack of 4 images taken from the games 80x80. The output is an array of 4 values, one for every direction. The problem ...
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 ...
0
votes
1answer
50 views

Is there a way to use AI to compare thousands of files and detect the ones containing "unusual" content?

Is there a way to use python and AI to compare thousands of files and detect the ones containing "unusual" content? Those files are supposed to have "homogeneous" configuration ...
1
vote
2answers
266 views

Are these book example CNN results realistic?

I've been following a deep learning book and the current section I'm on is about convolutional neural networks. The author presents some code to create a basic CNN with about 1 million parameters, ...
0
votes
0answers
12 views

Evaluating different board states with a minimax AI algorithm python

I am working on writing a connect 4 game as well as a minimax algorithm to play against. I am currently writing and implementing the minimax algorithm. Right now I am just trying to print out all ...
1
vote
1answer
311 views

Can agents be implemented with ML algorithms other than neural networks?

Can agents be implemented with machine learning algorithms/models other than neural networks? If so, how do I train an agent with some predefined rules? Can we use python programming for representing ...
1
vote
1answer
194 views

How to refine K-means clustering on a data set?

I'm working with a data set where the data is stored in a string such as AxByCyA where A, B ...
3
votes
2answers
2k views

How to perform gradient checking in a neural network with batch normalization?

I have implemented a neural network (NN) using python and numpy only for learning purposes. I have already coded learning rate, momentum, and L1/L2 regularization and checked the implementation with ...
0
votes
1answer
115 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 ...
2
votes
1answer
71 views

How to predict the "word" based on the meaning in a document?

What I mean to say is For example, if I give the meaning of Apple from the dictionary as input to the program, it should give output as Apple. Or I say My day to day job involves monitoring and ...
0
votes
0answers
19 views

Can I use a Mask R-CNN to detect a skin texture?

I'm trying to implement a solution in python to detect skin in an image. I'm evaluating the Mask R-CNN model to create a mask on the skin (not on clothes). The problem is that every solution I have ...
1
vote
1answer
37 views

Feature Extraction for printer classification

I need some advice. I am currently trying to do a printer classification with ML/DL. What do I have? 11 colored-images with high resolution from 8 different inkjet-printers (in total 88 images) I have ...
1
vote
0answers
48 views

Off-policy Bellman Operators: Writing Operator and Weight Update Function for a 2-State System

I am studying for RL on my own and was trying to solve this question I came across. Write an operator function $T(w, \pi, \mu, l, g)$ that takes weights $w$, a target policy $\pi$, a behaviour policy ...
60
votes
10answers
41k 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 ...
6
votes
2answers
561 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
33 views

What is the best machine learning algorithm for clustering dots based on coordinates $(x,y)$ with consideration of weight of the points?

I'm looking for a machine learning algorithm for clustering points based on their coordinates. Furthermore, I want to take into consideration the weights of each point. Suppose there is a weight in ...
0
votes
0answers
21 views

What model to train to restore MNIST test dataset

I came across this problem, and am not sure where to start. What model would work best for this problem and why? Imagine the digits in the test set of the MNIST dataset (http://yann.lecun.com/exdb/...
2
votes
0answers
44 views

My Gaussian Naive Bayes classifier is too slow

I am trying to build a film review classifier where I determine if a given review is positive or negative (w/ Python). I'm trying to avoid any other ML libraries so that I can better understand the ...
1
vote
1answer
380 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 ...
2
votes
1answer
418 views

Binary mode or Multi-label mode is correct when using binary crossentropy and sigmoid output function on multi-label classification

I would like to ask a question about the relationship of accuracy with the loss function. My experiment is a multiclass text classification problem, and I have built a Keras neural network to tackle ...
0
votes
0answers
16 views

What are the pros and cons of using a normal positional encoding in an adjacency matrix?

I understand that a normal positional encoding helps a transformer to understand pictures better and that it allows the (otherwise permutational invariant transformer-network) to create relationships ...
2
votes
0answers
36 views

How rewards are playing role in Deep Q Network

I have started working on Reinforcement Learning, specifically DQN. And I have watched some interesting videos on it. However, I have some doubts about how the model works. Let's say we are playing ...
0
votes
0answers
19 views

Which AI algorithm to use for identifying API for a specific use from a list of APIs?

We have a legacy code solution in C#. We have to change the code so that it fetches internal data via APIs and not via DB calls. E.g. if the current code GETS Payment object from DB, we have to ...
1
vote
1answer
47 views

What framework for a project with a custom environment?

I'm planning an RL project and I have to decide which RL framework do I use if any at all. The project has a highly custom environment, and testing different algorithms will be required to obtain ...
1
vote
1answer
144 views

How to create a Q-Learning agent when we have a matrix as an action space?

I have a 2-dimentional matrix as an action space, the rows being a resource to be allocated, and the columns are the users that we will allocate the resources to. (I built my own RL environment) The ...
-1
votes
1answer
57 views

Exploration for softmax should be binary or continuous softmax?

Maybe it's silly to ask but for random exploration in an RL for choosing discrete action, that in the neural network last layer softmax will be used, what random samples should we provide? binary like ...
0
votes
0answers
22 views

Adversarial Autoencoder is not working and not learning properly

I am trying to get an Adversarial AutoEncoder going using keras Fit method on a keras.model class but for some reason it is not working. Keep in mind that I tried updating encoder and decoder at the ...
0
votes
1answer
47 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 ...
1
vote
2answers
110 views

Running 2 NEAT nets on the same observations

So i have been playing around with neat-python. I made a program, applying neat, to play pinball on the Atari 2600. The code for that can be found in the file ...
2
votes
1answer
306 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
0answers
22 views

Find words in a raw text that are similar to a predefined array of words

I need a beginner advice regarding a simple application where I have a very limited set of topics in which i need to identify inside a user's natural language text/sentence. For example, one of the ...
0
votes
1answer
134 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
1answer
48 views

How to let the agent choose how to populate a state space matrix in RL (using python)

I have an agent (drone) that has to allocate subchannels for different types of User Equipment. I have represented the subchannel allocation with a 2-dimentional binary matrix, that is initialized to ...
1
vote
0answers
69 views

Implementation of MDP in python to determine when to take action clean

I am trying to model the following problem as a Markov decision process. In a steel melting shop of a steel plant, iron pipes are used. These pipes generate rust over time. Adding an anti-rusting ...
1
vote
1answer
39 views

What is the best open source python repo for facial recognition? [closed]

I am looking for best open source python repo for facial recognition. Best if it uses tensorflow backend. I know you can train images to recognize. Yolo can be used if trained on face. To name the ...
2
votes
1answer
145 views

GPFlow: Gaussian Process Uncertainty Quantification

I trained some Gaussian process model with the Python library GPFlow on a dataset consisting of $(X, Y)$, inputs and outputs, in a regression setting. This model gives me pretty good predictions in ...
1
vote
1answer
1k views

In Q-learning, shouldn't the learning rate change dynamically during the learning phase?

I have the following code (below), where an agent uses Q-learning (RL) to play a simple game. What appears to be questionable for me in that code is the fixed learning rate. When it's set low, it's ...
0
votes
1answer
88 views

Which of the following two implementations of a Least Squares classifier in Python is correct?

I am trying to solve a classification problem by implementing the Least Squares algorithm in Python. To solve this problem, I am implementing the linear algebra formula to train the classifier, which ...
0
votes
0answers
10 views

Categorical Location based Time Series data Prediction using LSTMs

I have some time series data with ActivityType as location shared below. Each CaseID has 6 unique values with different ...
0
votes
0answers
27 views

Why isn't my perceptron having the expected costs?

I want to implement a single perceptron for linear regression using the following formulas: The input data for the first case is one column (x(392, 1); y(392, 1)) ...
2
votes
1answer
74 views

How to generate a response while considering past questions as well?

User: What is the tallest mountain? Agent: Everest User: Where is it located? # Agent hears: "Where is Everest located?" Agent: Nepal I want to be able ...
2
votes
0answers
190 views

How does one continue the pre-training in BERT?

I need some help with continuing pre-training on Bert. I have a very specific vocabulary and lots of specific abbreviations at hand. I want to do an STS task. Let me specify my task: I have domain-...

1
2 3 4 5 6