Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [python]

For questions related to AI implementation in the Python language

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

What is a suitable measure to determine whether a superimposed line is on a grid line?

I have an image of a rotated grid. This grid has slightly darker pixels which I'm trying to detect. Due to the nature of the problem, my solution is to superimpose a grid onto the image which I can ...
MCE_Dia's user avatar
0 votes
0 answers
24 views

Segment a spectrogram into a series of images by (constant) beats per minute to train a Deep Neural Network

I have a .csv file with information about a soundtrack and it is divided into beats (per minute), which are ordered by row. As in: the index corresponds to each beat, and the columns have info about ...
Johnathan Smitherton's user avatar
0 votes
0 answers
22 views

No matter how I change a loss function I get it equal to infinity

I am a bioinformatician, and at the moment I am working with a dataset containing ~12.3 million mutations for ~5500 individuals. The goal is to perform binary classification. I use this framework to ...
YKY's user avatar
  • 101
0 votes
0 answers
7 views

Help With Converting NumPy Function To TensorFlow Ops (graph execution issue)

I'm trying to export my command recognition model for deploymenet on embedded devices, however, I'm facing trouble when trying to encapsulate the preprocessing function into my model, that way, when I ...
Aamar_Alberm3768's user avatar
0 votes
0 answers
7 views

Trying to use my first created Knowledge graph embeddings model

I'm trying to learn about creating and using knowledge graph embeddings models, I got a code, adapted it until I got no compiling or executing errors but now the predictions it mades are wrong. This ...
gnix's user avatar
  • 1
0 votes
0 answers
13 views

Optuna Hyperband Algorithm Not Following Expected Model Training Scheme

I have observed an issue while using the Hyperband algorithm in Optuna. According to the Hyperband algorithm, when min_resources = 5, max_resources = 20, and reduction_factor = 2, the search should ...
Tnb Marketplace's user avatar
0 votes
0 answers
23 views

Influence of Unused FFN on Model Accuracy in PyTorch

I am encountering a peculiar issue with my PyTorch model where the presence of an initialized but unused FeedForward Network (FFN) affects the model's accuracy. Specifically, when the FFN is ...
Riya's user avatar
  • 1
0 votes
0 answers
27 views

Yolov8 object detection model visualization in Netron

I trained a YOLOv8 nano detection model with imgsz=320 and 36 classes. When I conver it to ONNX, I get the following message: ...
Mary H's user avatar
  • 1
0 votes
0 answers
29 views

Why doesn't my toy transformer model "grok"?

I'm working on reproducing the results by Neel Nanda on teaching a small transformer to perform modular addition: (operand_1+operand_2)%mod_value. The expectation ...
LawlessWalrus's user avatar
0 votes
1 answer
62 views

Why is PPO not choosing a solution that is giving a higher cumulative reward?

I use PPO to train my fermenter (digital twin) to maximize enzyme (product) production. action: 1 or 0 ie. add substrate at a particular time or not based on cell and enzymes present in the tank ...
user79474's user avatar
1 vote
0 answers
51 views

Python libraries for mulit-armed bandit problems [closed]

I am working on a problem that can be casted as a contextual bandit problem with continuous action space. I would like to tackle it by using something like the contextual zooming algorithm from the ...
Onil90's user avatar
  • 183
2 votes
1 answer
57 views

How does reward work while training a Reinforcement Learning agent?

I am using PPO to train my environment which I created using stable baselines 3. I am confused if I should make the reward = 0 in the step function or not. Initially, I used to have self.reward = 0 in ...
user79474's user avatar
0 votes
0 answers
25 views

Chat with your DB: How to get AI to follow your rules?

Context/Background: I have a single table in MySQL with info on 'members', including things like location, favourite types of music, favourite camping spots, etc. Required Behaviour: I need the system ...
Blue Da Noob's user avatar
0 votes
0 answers
42 views

Understanding the concepts of embedding in Roberta architecture?

I'm reading the implementation file of Roberta architecture, specifically in the RobertaEmbedding class, this class has the comment: ...
user avatar
0 votes
1 answer
38 views

How to Create a 1D Embedding from Tensors of Varying Sizes?

I am a newbie in AI and playing with some computer vision algorithms. I have three tensors with different sizes. Noise augmentation levels tensor with size (N, C, H, W), diffusion timestep tensor of ...
Pooya Kamranjam's user avatar
0 votes
0 answers
21 views

Need Expert Advice for using sklearn pipeline to create a composite estimator with multiple models & features

I am trying to use sklearn pipeline to create a composite estimator. Please check attached image for model blueprint. Can anyone help me understand how this can be done in python. Column Transformer ...
prafull ghare's user avatar
0 votes
0 answers
33 views

Reinforcement Learning agent converging at the lowest reward

I have a custom environment created using Stable Baselines 3 where the environment is a digital twin of a fermentation reaction. It observes the enzyme activity which is the output of the fermentation ...
user79474's user avatar
0 votes
0 answers
16 views

What are efficient methods for classifying tremor intensity, given challenges with 3D CNN and memory issues with a pretrained VideoMAE model?

I have a training dataset of 80 videos (without augmentation). They are 15 seconds video recorded at 30fps and 240*480 dimensions. What options do I have to train a classification model? The problem ...
Ravideep Singh's user avatar
1 vote
0 answers
631 views

Finetuning Mistral or MistralForSequenceClassification for text classification

I need to do text classification and have a dataset of 10K entries. I am considering using mistral and following a tutorial like https://huggingface.co/docs/transformers/training and replace model ...
Karl 17302's user avatar
0 votes
1 answer
27 views

Keras accuracy does not change for multi-output module

I want to predict the penalty/punishment given for fraud cases, with inputs in the form of (damage amount(\$), if recidivism), and targets in the format of (fine(\$), jail(months), community service(...
Aliquis's user avatar
3 votes
0 answers
92 views

Is improving a Neural Network really just "trial and error"?

After asking on StackOverflow, I was redirected here, so I'm reposting this question. I am a PhD student in Computational Physics and I've started to study a bit of Neural Networks, and decided to try ...
Mauro Giliberti's user avatar
0 votes
0 answers
29 views

How to let the AI trained on MNIST recognize my own hand-written number?

I have already trained a simple model without using any frameworks to recognize the hand-written numbers from the MNIST dataset. Actually it's just a copy of the example on the book Grokking ...
Jason Jia's user avatar
0 votes
0 answers
25 views

NaN gradients while Training (but loss isn't NaN neither the computational graph is disconnected)

The reason I am asking this here is that I haven't found a bug in my code and maybe there isn't a bug at all (or maybe there is). I just want to validate the idea that I am trying to implement. Here ...
Ryukendo Dey's user avatar
1 vote
1 answer
82 views

Why are these two implementations of the $\epsilon$-greedy policy different?

According to the book Reinforcement Learning An Introduction, the epsilon greedy policy can generally implemented as: $$ \pi(a|s) = \begin{cases} \frac{\epsilon}{|A|} + 1 - \epsilon & \text{if } ...
kklaw's user avatar
  • 185
2 votes
0 answers
139 views

cGAN: Discriminator loss going to zero while Generator's going always up but the result is very good

I have a Conditional Generative Adversarial Network for Quantum State Tomography. The metrics I am monitoring during the training process are the losses and the Fidelity (the degree of similarity ...
Dimitri's user avatar
  • 23
1 vote
1 answer
77 views

RL agent for autonomous vehicle is able to follow the road but can't avoid crashing at all (Highway-Env / Racetrack Env.)

I coded some deep RL algorithms (DQN and SAC) with tf2/keras to solve an environment where a vehicle needs to follow the track and avoid crashing into one other vehicle (there is only one other ...
rafiqollective's user avatar
-2 votes
1 answer
62 views

How to run our python scripts utilizing our device's GPU? [closed]

My laptop has NVIDIA GeForce GTX1650 GPU. I want to utilize this GPU to run my Python script. Any help in the form of code would be really helpful. I mean tried researching this so much but I couldn't ...
Escanor6's user avatar
0 votes
0 answers
26 views

How to make a RandomForestRegressor learn to differentiatie similar inputs with different outputs?

I'm working on a regression task with Sklearn RandomForestRegressor and I'm having some trouble distinguishing between two similar data with very different expected outputs. For example, each pair of ...
Luís Henrique Bandória's user avatar
0 votes
0 answers
63 views

Change face landmarks using face mesh

I'm trying to use computer vision or image processing techniques to make nose smaller. Using a SDK called mediapipe we are able to get face mesh, which provides ...
Mary's user avatar
  • 973
0 votes
1 answer
95 views

Setting number of rows returned by vector stores

When using vector stores like pinecone or Faiss from langchain, is it possible to set the number of records returned based on similarity search? For example, consider the following code, is there a ...
Karl 17302's user avatar
0 votes
0 answers
18 views

How is the accuracy as a metric in a Keras machine learning model calculated? Is it a valuable metric for LSTM

I'm training a LSTM neural network for time series prediction in Keras. During the training of the model, the loss (mse) gradually decreases each epoch, but the accuracy as well as the validation ...
Mappy's user avatar
  • 1
0 votes
1 answer
37 views

Data out of scale

Imagine that you want to train a deep learning model for forecasting/transforming data and have a training dataset with endpoints 0 and 1000. Now, Imagine receiving a new dataset with endpoints 0 and ...
Nathaldien's user avatar
0 votes
0 answers
49 views

New input to NEAT not improving learning

I have a set of NEAT inputs for a jump game but the learning was getting stuck at one point. Consider the following screen where Z is the player and ...
paxdiablo's user avatar
  • 101
0 votes
0 answers
28 views

Confusion about the code for choosing "stumps" in Adaboost algorithm

(I actually asked the following question on Stack Overflow and Cross Validated Exchange for more than a month: https://stackoverflow.com/questions/76842431/confusion-about-the-code-for-choosing-...
Richard's user avatar
  • 101
0 votes
0 answers
1k views

Why are the vector stores I generate via langchain FAISS from_documents always ~4.8 GB in size?

I am working on a small application to query a set of PDF documents. Specifically, I am aiming to provide the same query to each document in parallel, not to all documents as a whole. I have utilized <...
KDecker's user avatar
  • 101
0 votes
0 answers
23 views

ROC curve for multiclassification - results sound not correct

I'm working on a multiclassification task using LSTM algorithm, i generated my roc curve plots but they give scores like 1 , 0.99, 0.97 however i have an accuracy of 0.97, Precision 0.65, Sensitivity/...
biihu's user avatar
  • 1
0 votes
0 answers
36 views

MultiLayer Perceptron not working for regression problem, what could I try?

I am trying to learn the inverse kinematics of a robotic manipulator. To do that I have a simulator with which I acquired data. My dataset is composed of positions in X, Y and Z and actuator variables ...
Guillaume's user avatar
0 votes
0 answers
179 views

How to implement Image Fusion Equation in Python

I am new to image processing. I am trying to implement this paper. (official implementation is available on github the link for the same is given below) I have applied one fusion strategy. I am not ...
programmer_04_03's user avatar
0 votes
0 answers
70 views

Backpropagation in a transformer

I have a transformer for timeseries forcasting based on this article https://arxiv.org/abs/2001.08317 Given a source containing $src=(x_{t-5},x_{t-4},x_{t-3},x_{t-2},x_{t-1})$ and a target of $tgt=(x_{...
Michał Kuczynski's user avatar
2 votes
0 answers
37 views

What's the result of multiple neurons using ReLU activation function?

This question comes from a doubt that I recently had on an amazing book called "Neural Networks from Scratch With Python by Harrison Kinsley & Daniel Kukieła" Let's suppose that I have ...
Tomorrow's user avatar
1 vote
2 answers
60 views

How to Represent Boardless Board Game as Input to RL Model?

I am currently doing my thesis project by creating an Imitation Learning (IL) agent that learns to play the board game Hive, which lacks a traditional 2D board. Pieces are placed relative to one ...
Johnny McKenzie's user avatar
0 votes
0 answers
34 views

Improving Fuzzy Logic Control System Results

I am new to using skfuzzy and the use of fuzzy logic for classification, but the results I am getting are both good and bad for some conditions. I am aware of the overarching impact the ...
GEobserver's user avatar
0 votes
0 answers
42 views

Updating custom output layers of an LSTM network

I have a text generation task learning to predict the next word with an LSTM network with multiple output layers. After the generation of a sentence has finished, I calculate a reward for the whole ...
eris's user avatar
  • 1
1 vote
1 answer
283 views

Getting always the same action on an A2C from stable_baselines3

I'm quite new to RL and have been trying to train an A2C model from stable_baselines3 to derive an integer sequence based on 3 other input sequences of floats. I have a custom gym environment that ...
Jesuspc's user avatar
  • 151
0 votes
0 answers
213 views

Feature Importance for FT Transformer

I hope someone is able to shed light on this. I was reading through the codes on this link with regards to getting feature importance from attention scores. https://github.com/aruberts/...
DDM's user avatar
  • 101
0 votes
1 answer
37 views

Patterns binary classification - model doesn't overfit

I am working on a very basic binary classification problem. For each set of four float numbers $(x,y,z,w)$, I want to check if they fall or not into one category. I have written a model with 3 dense ...
apt45's user avatar
  • 123
0 votes
0 answers
21 views

What model should I use to find coordinate locations of objects on an image (not bounding boxes)

I am developing a neural network to count pits on an etched crystal wafer, and I created a dataset by placing points on each pit. Each line in my annotation file looks like this: Id, Filepath, ...
Jesse Wolf's user avatar
0 votes
0 answers
386 views

Tips for solving OpenAI/Faramas Gymnasium Car Racing Environment

Im quite new to ML and wanna solve Gyms Car Racing v2 using Q-Learning with a Q-Table. But I am having problems approaching this. Thats why I am hoping someone more advanced in this field could give ...
user72952's user avatar
0 votes
0 answers
65 views

What is the best approach to remove this additional container from the cropped image?

I'm working on a computer vision application in Python to analyze images of ice cream cuttings to measure the amount of variegate(ie. fruit syrup or fudge) compared to the base ice cream. My approach ...
RustyGoat's user avatar
0 votes
1 answer
214 views

Can transformer models be used to convert code from one programming language to another?

There was a question like this in 2019. I hope things have changed since then. Concretely, I am looking for a way to train a transformer model to convert code from SAS to Python. I guess the method ...
Vladimir's user avatar

1
2 3 4 5
8