Skip to main content
Planned maintenance impacting Stack Overflow and all Stack Exchange sites is scheduled for Monday, September 16, 2024, 5:00 PM-10:00 PM EDT (Monday, September 16, 21:00 UTC- Tuesday, September 17, 2:00 UTC). The email/password authentication method will be unavailable for logging in and registering. Read more here

Questions tagged [python]

For questions related to AI implementation in the Python language

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

How to categorize and identify the most requested features from 1000+ GitHub issues using an LLM agent?

I have scraped over 1000+ GitHub issues from a repository using Crawlee. My goal is to segregate these issues based on their descriptions, title, number of comments and statuses. I want to identify ...
Khushi Rani's user avatar
1 vote
1 answer
28 views

How Do I Optimise a Black-Box Objective Function with DQN Using Reinforcement Learning?

I'm a beginner in the field of reinforcement learning, and I'm currently working on a problem that has me a bit stuck. I'm trying to optimize a black-box objective function using reinforcement ...
Shahriar Namazzadeh's user avatar
2 votes
1 answer
26 views

Labeling policy for airplane detecting YOLO

I am training my YOLO to detect airplanes and drones. in some of the pictures it is impossible to detect that the object is indeed an airplane, and it even looks like a drone (pictures are taken from ...
Or Perez's user avatar
0 votes
0 answers
25 views

Python implementation of Label Ranking Trees

Label Ranking is a classification task in which there is a set of potential labels; given a feature vector, the classifier should decide how to rank the labels from most-relevant to least-relevant. As ...
Erel Segal-Halevi's user avatar
0 votes
0 answers
8 views

Why VGG fine tuning process keeps crashing in colab?

0 I am trying to fine-tune a VGG16 model for an ECG-image classification task with the resolution of 1700 * 2200 I haven't reshaped and reduced the size of the images because I thought some ...
rav2001's user avatar
  • 101
1 vote
1 answer
91 views

Custom Loss Function Traps Network in Local Optima

I am working with a feedforward neural network to fit the following simple function: N(1) = -1 N(2) = -1 N(3) = 1 N(4) = -1 But I don't want to use the Mean-...
Andrew Baker's user avatar
0 votes
0 answers
17 views

Training Image Classifier with 7 classes but my model is overfitting resulting the accuracy of the model to behave weirdly during training

I am training an image classifier for 7 different model types of a specific car engine parts. Each class has exactly 308 grayscale images with the same resolution of 1014x760. Those images consists ...
rekoilS's user avatar
0 votes
0 answers
23 views

PPO with multiple actions per action vector

I would like to have the following vector for example [0.2,0.6,0.3,0.4,0.8] end up looking like this after training [0,1,0,0,1]. In other words , rather than choosing one action, I'm choosing more ...
Tofara Moyo's user avatar
0 votes
0 answers
21 views

PyTorch and Opacus for Differential Privacy

When testing an example code from the TensorFlow website using Jupyter Notebook, which is available at the following link: [LINK_1], I encountered an error. You can find my question about that error ...
Questioner's user avatar
0 votes
0 answers
23 views

Ways to implement AI table search

I am new to this matter, so I ask for your help. I have a table with 3 columns: ID, title and description.I want to implement an AI search through data and return ID of the record, if one was found. ...
Dvashington's user avatar
0 votes
0 answers
23 views

Is there a collection of tutorials that focus on minimalism?

There is an endless amount of frameworks, libraries and models now with a corresponding amount of tutorials. But most of them are quite verbose and somewhat unfocused. Is there any collection of ...
user2845840's user avatar
0 votes
0 answers
19 views

What to do after cross-validation?

After using cross-validation to see how a custom predictive function performs on unseen data, I applied to function to the original dataset, and the performance (based on coefficient of determination) ...
Beginner's user avatar
0 votes
0 answers
14 views

Spikes in Loss During Training both train/val datasets with LSTM

I'm seeing good results I think, but I want to understand why these spikes in loss are occuring. As you can see, it would appear that my training is working as it should, but every 200 or so epochs ...
Romuloux's user avatar
  • 101
0 votes
0 answers
30 views

Cross validation and MICE imputation

I'm working on a binary classification problem where I have some missing data. My initial idea was to use MiceForest. I'm also using stratified k fold technique (Data is imbalanced). I also want to ...
chapu's user avatar
  • 1
0 votes
0 answers
40 views

SSIM in validation higher then SSIM in training for image denoising

I'm working to denoise microscopy images using a 2D U-Net. I'm training my network on images taken at different z-levels, and these images have ground truth, which is the mean of the images in z. ...
Fab G's user avatar
  • 16
0 votes
0 answers
20 views

Architecture of an LSTM with multiple (dependent?) time series

If you have multiple time series data for a given problem (e.g predicting house prices and data is available per city). Per city there is a list of features and the target feature. If you want to ...
HEH's user avatar
  • 1
0 votes
0 answers
21 views

Not guessing when tuning neural networks

I have a NN with about 750 inputs (sparsely encoded text, mostly). The output is 1 cell - yes or no, this is of type X. I can guess all day long on the size and depth of my hidden layers. I hate ...
Tony Ennis's user avatar
0 votes
0 answers
13 views

Troubles using unsupervised domain adaptation

Hope somebody can help me, I've been stucked on this and there's no way I can find the origin of my problem... So I have a model that I have fine-tuned, it's a resent18 that looks like this (I'm just ...
Georgia's user avatar
0 votes
0 answers
50 views

custom neural network implementation is giving 10% accuracy on mnist dataset

I've created a toy neural network in python for learning purposes and decided to test it on mnist dataset, I didn't expect great results but the result that I got - 10% is as good as a guess. For many ...
bearthum's user avatar
0 votes
0 answers
41 views

How to fix segmentation model producing black segmentation masks?

Apologies in advance for incorrect formatting, I've been kindly sent here after posting my question on StackOverflow. We're training a segmentation model using Snapchat's template for custom ...
Wilrick B's user avatar
0 votes
1 answer
93 views

How to use the tf.image.SSIM function [closed]

Can anyone please help me understand how to use this SSIM function (https://www.tensorflow.org/api_docs/python/tf/image/ssim)? The filter_size parameter has a ...
Marco's user avatar
  • 119
1 vote
0 answers
18 views

Best method for finding centroid of 3D object?

I'm somewhat new to machine learning and want to implement a manufacturing application that finds the centroid of an irregular object so that as little material as possible is removed during ...
dstoddard's user avatar
1 vote
0 answers
43 views

How exactly do you backpropagate the gradient penalty in WGAN-GP?

I am trying to implement WGANs from scratch. The loss function for the critic is given by : which i implement in my code as L = average(real output) - average(fake output) + lambda*GP. For ...
hidden_machine's user avatar
0 votes
0 answers
18 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
35 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
47 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
11 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
12 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
17 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
24 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
59 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
  • 101
0 votes
0 answers
44 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
164 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
90 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
64 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
28 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
86 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
23 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
36 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
760 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
32 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
31 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
42 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
110 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
  • 195
2 votes
0 answers
204 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
87 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
101 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

1
2 3 4 5
8