Questions tagged [machine-learning]

Implementation questions about machine learning algorithms. General questions about machine learning (concepts, theory, methodology, terminology, etc.) should be posted to their specific communities.

Machine learning revolves around developing self-learning computer algorithms that function by virtue of discovering patterns in data and making intelligent decisions based on such patterns.

Machine learning is a subfield of computer science that evolved from the study of pattern recognition and computational learning theory in artificial intelligence. Machine learning explores the construction and study of algorithms that can learn from and make predictions about data. Such algorithms operate by building a model from example inputs in order to make data-driven predictions or decisions rather than following strictly static program instructions.

NOTE: If you want to use this tag for a question not directly concerning implementation, then consider posting on Cross Validated, Data Science, or Artificial Intelligence instead; otherwise you're probably off-topic. Please choose one site only and do not cross-post to more than one - see Is cross-posting a question on multiple Stack Exchange sites permitted if the question is on-topic for each site? (tl;dr: no).

Classic Problems:

Relevant Algorithms:

Applications:

Software:

Related-tags:

Video Lectures:-

55241 questions
12
votes
3 answers

metric learning and contrastive learning difference

I researched some materials,and know that the goal of contrastive learning and metric learning are both to learn such an embedding space in which similar sample pairs stay close to each other while dissimilar ones are far apart. But what is the…
12
votes
1 answer

Inference using saved model in Tensorflow 2: how to control in/output?

Adapting my code from TF1 to TF2.6 I run into trouble. I am trying to add some custom layers to an inception resnet, save the model, and then load and run it. from tensorflow.keras.layers import Dense …
user1981275
  • 13,002
  • 8
  • 72
  • 101
12
votes
1 answer

Why are these words considered stopwords?

I do not have a formal background in Natural Language Processing was wondering if someone from the NLP side can shed some light on this. I am playing around with the NLTK library and I was specifically looking into the stopwords function provided by…
Legend
  • 113,822
  • 119
  • 272
  • 400
12
votes
1 answer

How to build hybrid model of RF(Random Forest) and PSO(Particle Swarm Optimizer) to find optimal discount of products?

I need to find optimal discount for each product (in e.g. A, B, C) so that I can maximize total sales. I have existing Random Forest models for each product that map discount and season to sales. How do I combine these models and feed them to an…
12
votes
1 answer

UnboundLocalError: local variable 'batch_outputs' referenced before assignment

I am writing machine learning code using Keras to grade the severity of prostate cancer. After running it the following error appears: --------------------------------------------------------------------------- UnboundLocalError …
user10055134
  • 139
  • 1
  • 5
12
votes
2 answers

OpenAI GPT-2 model use with TensorFlow JS

Is that possible to generate texts from OpenAI GPT-2 using TensorFlowJS? If not what is the limitation, like model format or ...?
jay
  • 477
  • 5
  • 13
12
votes
2 answers

fisher's linear discriminant in Python

I have the fisher's linear discriminant that i need to use it to reduce my examples A and B that are high dimensional matrices to simply 2D, that is exactly like LDA, each example has classes A and B, therefore if i was to have a third example they…
xnok
  • 299
  • 2
  • 6
  • 35
12
votes
3 answers

Can someone explain to me how MinMaxScaler() works?

Why we are using the MinMaxScaler() and what does it do? scaler = MinMaxScaler() scaler.fit(X_train) X_train = scaler.transform(X_train) X_test = scaler.transform(X_test) model = LogisticRegression() model.fit(X_train, y_train) y_pred =…
Akarsh Sharma
  • 147
  • 1
  • 1
  • 8
12
votes
4 answers

Validation loss for pytorch Faster-RCNN

I’m currently doing object detection on a custom dataset using transfer learning from a pytorch pretrained Faster-RCNN model (like in torchvision tutorial). I would like to compute validation loss dict (as in train mode) at the end of each epoch. I…
12
votes
1 answer

Difference between Keras' BatchNormalization and PyTorch's BatchNorm2d?

I've a sample tiny CNN implemented in both Keras and PyTorch. When I print summary of both the networks, the total number of trainable parameters are same but total number of parameters and number of parameters for Batch Normalization don't match.…
Kaushal28
  • 5,377
  • 5
  • 41
  • 72
12
votes
2 answers

'tensorflow' has no attribute 'config'

I am trying to run the following line: print("Num GPUs Available: " , len(tensorflow.config.experimental.list_physical_devices('GPU'))) But it returns the error: AttributeError: module 'tensorflow' has no attribute 'config' Any ideas what I'm…
Moiz Khan
  • 121
  • 1
  • 1
  • 4
12
votes
5 answers

Randomness in Artificial Intelligence & Machine Learning

This question came to my mind while working on 2 projects in AI and ML. What If I'm building a model (e.g. Classification Neural Network,K-NN, .. etc) and this model uses some function that includes randomness. If I don't fix the seed, then I'm…
12
votes
4 answers

How can I use tf.keras.Model.summary to see the layers of a child model which in a father model?

I have a subclass Model of tf.keras.Model,code is following import tensorflow as tf class Mymodel(tf.keras.Model): def __init__(self, classes, backbone_model, *args, **kwargs): super(Mymodel, self).__init__(self, args, kwargs) …
Mozhenwei
  • 135
  • 1
  • 1
  • 6
12
votes
4 answers

How to improve digit recognition of a model trained on MNIST?

I am working on handprinted multi-digit recognition with Java, using OpenCV library for preprocessing and segmentation, and a Keras model trained on MNIST (with an accuracy of 0.98) for recognition. The recognition seems to work quite well, apart…
youngpanda
  • 416
  • 1
  • 4
  • 13
12
votes
3 answers

Keras conditional passing one model output to another model

I am trying to neural network in keras, which first check if its a cat or dog (base model). if it is a dog, then it is passes through another model (sub-model-1) if it is a cat, then it is passes through another model (sub-model-2) Sub-model are…