104
votes
Training an RNN with examples of different lengths in Keras
This suggests that all the training examples have a fixed sequence length, namely timesteps.
That is not quite correct, since that dimension can be ...
58
votes
Accepted
What is the advantage of keeping batch size a power of 2?
This is a problem of alignment of the virtual processors (VP) onto the physical processors (PP) of the GPU. Since the number of PP is often a power of 2, using a number of VP different from a power of ...
43
votes
Why is it wrong to train and test a model on the same dataset?
Yes, you put it quite correctly.
As a teacher, you wouldn’t give your students an exam that’s got the exact same exercises you have provided as homework: you want to find out whether they (a) have ...
40
votes
Should a model be re-trained if new observations are available?
When new observations are available, there are three ways to retrain your model:
Online: each time a new observation is available, you use this single data point to further train your model (e.g. ...
33
votes
Is it always better to use the whole dataset to train the final model?
A point that needs to be emphasized about statistical machine learning is that there are no guarantees. When you estimate performance using a held-out set, that is just an estimate. Estimates can be ...
33
votes
In the context of Deep Learning, what is training warmup steps
As the other answers already state: Warmup steps are just a few updates with low learning rate before / at the beginning of training. After this warmup, you use the regular learning rate (schedule) to ...
32
votes
Accepted
Should a model be re-trained if new observations are available?
Once a model is trained and you get new data which can be used for training, you can load the previous model and train onto it. For example, you can save your model as a ...
27
votes
Accepted
In the context of Deep Learning, what is training warmup steps
This usually means that you use a very low learning rate for a set number of training steps (warmup steps). After your warmup steps you use your "regular" learning rate or learning rate scheduler. You ...
24
votes
Accepted
Train, test split of unbalanced dataset classification
Best way is to collect more data, if you can.
Sampling should always be done on train dataset. If you are using python, scikit-learn has some really cool packages to help you with this. Random ...
23
votes
Is it always better to use the whole dataset to train the final model?
I personally haven't seen that for products going into production, but understand the logic.
Theoretically, the more data your deployed model has seen, the better is should generalise. So if you ...
21
votes
What would I prefer - an over-fitted model or a less accurate model?
There are a couple of nuances here.
Complexity question very important - ocams razor
CV - is this trully the case 84%/83% (test it for train+test with CV)
Given this, personal opinion: Second one.
...
19
votes
Is it always better to use the whole dataset to train the final model?
Once you have obtained optimal hyperparamters for your model, after training and cross validating etc., in theory it is ok to train the model on the entire dataset to deploy to production. This will, ...
15
votes
What would I prefer - an over-fitted model or a less accurate model?
It depends mostly on the problem context. If predictive performance is all you care about, and you believe the test set to be representative of future unseen data, then the first model is better. (...
14
votes
Is stratified sampling necessary (random forest, Python)?
If the number of values belonging to each class are unbalanced, using stratified sampling is a good thing. You are basically asking the model to take the training and test set such that the class ...
13
votes
Why is it wrong to train and test a model on the same dataset?
It is wrong because:
it is fundamentally incorrect (a theoretical concern)
it leads to bad results (a practical concern)
It is fundamentally incorrect because usually the objective of testing a ...
12
votes
Training an RNN with examples of different lengths in Keras
@kbrose seems to have a better solution
I suppose the obvious thing to do would be to find the max length of any sequence in the training set and zero pad it.
This is usually a good solution. ...
12
votes
Accepted
Understanding how convolutional layers work
What are the filters?
A filter/kernel is a set of learnable weights which are learned using the backpropagation algorithm. You can think of each filter as storing a single template/pattern. When you ...
11
votes
Oversampling/Undersampling only train set only or both train and validation set
Oversample the train data and NOT the validation data since if train data is unbalanced, your test data will most likely show the same trait and be unbalanced.
If you don't know if test data will be ...
10
votes
Accepted
Meaning of stratify parameter
stratify parameter will preserve the proportion of target as in original dataset, in the train and test datasets as well.
So if your original dataset ...
9
votes
Accepted
Tool to label images for classification
I just hacked together a very basic helper in python
it requires that all images are stored in a pyton list allImages.
...
9
votes
Accepted
How to train data by batch from disk?
As you are working on image classification and would also like to implement some data augmentation, you can combine the two AND load the batches directly from a folder using the mighty '...
9
votes
Accepted
May the training set and validation set overlap?
Definitions, so we are on the same page:
Training set: the data points used to train the model.
Validation set: the data points to keep checking the performance of your model in order to know when to ...
9
votes
What would I prefer - an over-fitted model or a less accurate model?
The first has an accuracy of 100% on training set and 84% on test set. Clearly over-fitted.
Maybe not. It's true that 100% training accuracy is usually a strong indicator of overfitting, but it's ...
8
votes
How to deal with large training data?
I do something similar with keras and GPU training, where i also have only a small memory amount available. The idea would be split the numpy files into smaller ones, let's say 64 samples per file and ...
8
votes
Accepted
What knowledge do I need in order to write a simple AI program to play a game?
There are multiple ways to approach solving game playing problems. Some games can be solved by search algorithms for example. This works well for card and board games up to some level of complexity. ...
8
votes
Accepted
Train object detection without annotated data/bounding boxes
Yes, there are models that do this. This link points to one of the first papers I believe. The main idea is called weakly supervised object detection.
The paper essentially makes three modifications.
...
8
votes
99% validation accuracy but 0% prediction results (UNET Architecture)
There is no "mismatch" of accuracy. Your problem is that you have an image segmentation problem where 99% of the pixels should be zero. So getting 99% accuracy is trivially easy. A model that predicts ...
8
votes
Accepted
Number of features of the model must match the input. Model n_features is `N` and input n_features is `X`.
You are supposed to pass numpy arrays and not lists as arguments to the DecisionTree, since your input was a list it gets ...
8
votes
Accepted
Does increasing kernel size in a CNN result in higher accuracy on the training set?
I'd say there is no direct relation between the kernel size and the accuracy.
If you start using larger kernel you may start loosing details in some smaller features (where 3x3 would detect them ...
8
votes
Why is it wrong to train and test a model on the same dataset?
It can happen that the model you train learns "too much" or memorizes the training data, and then it performs poorly on unseen data. This is called "overfitting".
The problem of ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
training × 683machine-learning × 228
neural-network × 135
deep-learning × 115
dataset × 66
python × 59
classification × 52
cross-validation × 49
keras × 48
tensorflow × 39
time-series × 31
accuracy × 30
cnn × 29
overfitting × 27
machine-learning-model × 26
scikit-learn × 25
lstm × 25
convolutional-neural-network × 25
predictive-modeling × 21
loss-function × 21
validation × 21
nlp × 20
data × 19
pytorch × 18
prediction × 16