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
104
votes
3 answers

What is the difference between np.mean and tf.reduce_mean?

In the MNIST beginner tutorial, there is the statement accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float")) tf.cast basically changes the type of tensor the object is, but what is the difference between tf.reduce_mean and np.mean? Here…
O.rka
  • 29,847
  • 68
  • 194
  • 309
103
votes
4 answers

How to do gradient clipping in pytorch?

What is the correct way to perform gradient clipping in pytorch? I have an exploding gradients problem.
Gulzar
  • 23,452
  • 27
  • 113
  • 201
102
votes
2 answers

What is the intuition of using tanh in LSTM?

In an LSTM network (Understanding LSTMs), why does the input gate and output gate use tanh? What is the intuition behind this? It is just a nonlinear transformation? If it is, can I change both to another activation function (e.g., ReLU)?
102
votes
8 answers

How big should batch size and number of epochs be when fitting a model?

My training set has 970 samples and validation set has 243 samples. How big should batch size and number of epochs be when fitting a model to optimize the val_acc? Is there any sort of rule of thumb to use based on data input size?
pr338
  • 8,730
  • 19
  • 52
  • 71
101
votes
3 answers

What is the difference between sparse_categorical_crossentropy and categorical_crossentropy?

What is the difference between sparse_categorical_crossentropy and categorical_crossentropy? When should one loss be used as opposed to the other? For example, are these losses suitable for linear regression?
xpertdev
  • 1,293
  • 2
  • 6
  • 12
101
votes
3 answers

Keras: Difference between Kernel and Activity regularizers

I have noticed that weight_regularizer is no more available in Keras and that, in its place, there are activity and kernel regularizer. I would like to know: What are the main differences between kernel and activity regularizers? Could I use…
Simone
  • 4,800
  • 12
  • 30
  • 46
100
votes
9 answers

What is machine learning?

What is machine learning ? What does machine learning code do ? When we say that the machine learns, does it modify the code of itself or it modifies history (database) which will contain the experience of code for given set of inputs?
Kushal Waikar
  • 2,976
  • 5
  • 26
  • 31
100
votes
5 answers

Recovering features names of explained_variance_ratio_ in PCA with sklearn

I'm trying to recover from a PCA done with scikit-learn, which features are selected as relevant. A classic example with IRIS dataset. import pandas as pd import pylab as pl from sklearn import datasets from sklearn.decomposition import PCA # load…
sereizam
  • 2,048
  • 3
  • 20
  • 29
99
votes
10 answers

Does Any one got "AttributeError: 'str' object has no attribute 'decode' " , while Loading a Keras Saved Model

After Training, I saved Both Keras whole Model and Only Weights using model.save_weights(MODEL_WEIGHTS) and model.save(MODEL_NAME) Models and Weights were saved successfully and there was no error. I can successfully load the weights simply using…
Rizwan
  • 1,210
  • 2
  • 9
  • 21
99
votes
7 answers

Unsupervised clustering with unknown number of clusters

I have a large set of vectors in 3 dimensions. I need to cluster these based on Euclidean distance such that all the vectors in any particular cluster have a Euclidean distance between each other less than a threshold "T". I do not know how many…
98
votes
2 answers

How to create a new gym environment in OpenAI?

I have an assignment to make an AI Agent that will learn to play a video game using ML. I want to create a new environment using OpenAI Gym because I don't want to use an existing environment. How can I create a new, custom Environment? Also, is…
Rifat Bin Reza
  • 2,601
  • 2
  • 14
  • 29
98
votes
5 answers

What's the difference between a bidirectional LSTM and an LSTM?

Can someone please explain this? I know bidirectional LSTMs have a forward and backward pass but what is the advantage of this over a unidirectional LSTM? What is each of them better suited for?
97
votes
10 answers

How to implement the ReLU function in Numpy

I want to make a simple neural network which uses the ReLU function. Can someone give me a clue of how can I implement the function using numpy.
Andoni Zubizarreta
  • 1,275
  • 1
  • 15
  • 23
95
votes
9 answers

What is inductive bias in machine learning?

What is inductive bias in machine learning? Why is it necessary?
haguki-taro
  • 1,001
  • 1
  • 8
  • 6
93
votes
5 answers

Calculate the output size in convolution layer

How do I calculate the output size in a convolution layer? For example, I have a 2D convolution layer that takes a 3x128x128 input and has 40 filters of size 5x5.
Monk247uk
  • 1,170
  • 1
  • 8
  • 15