This suggests that all the training examples have a fixed sequence length, namely timesteps.
That is not quite correct, since that dimension can be None, i.e. variable length. Within a single batch, you must have the same number of timesteps (this is typically where you see 0-padding and masking). But between batches there is no such restriction. During ...
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 actually understood the intuition behind the methods you taught them and (b) make sure they haven’t just memorised the homework exercises.
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 2 leads to poor performance.
You can see the mapping of the VP onto the PP as a pile of slices of size the number of PP.
Say you've got 16 PP.
You can map 16 ...
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. load your current model and further train it by doing backpropagation with that single observation). With this method, your model learns in a sequential manner and ...
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 .pickle file and load it and train further onto it when new data is available. Do note that for the model to predict correctly, the new training data should have a similar distribution as ...
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.
Better to catch general patterns. You already know that first model failed on that because of the train and test difference. 1% says nothing.
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 sampling is a very bad option for splitting. Try stratified sampling. This splits your class proportionally between training and test set.
Run oversampling, ...
Interesting question. 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 trained the model on the full set of data you have available, it should generalise better than a model which only saw for example train/val ...
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, in theory, generalise better.
HOWEVER, you can no longer make statistical / performance claims on test data since you no longer have a test dataset.
If you ...
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 proportion is same as of the whole dataset, which is the right thing to do. If your classes are balanced then a shuffle (no stratification needed here) can ...
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. (This might be the case for, say, health predictions.)
There are a number of things that would change this decision.
Interpretability / explainability. This is ...
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 wrong.
This takes some getting used to, but it's something you're going to have to get comfortable with. When you say "What if the performance actually ...
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 train your model to convergence.
The idea that this helps your network to slowly adapt to the data intuitively makes sense. However, theoretically, the main ...
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 convolve this filter across the corresponding input, you are basically trying to find out the similarity between the stored template and different locations in ...
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 model is to estimate how well it will perform predictions on data that the model didn't see.
It's quite hard to come up with good estimates of real-world ...
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 then load each file and call train_on_batch on those images. You can use keras' train_on_batch function to achieve this:
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. For instance, IBM's Deep Blue was essentially a fast heuristic-driven search for optimal moves.
However, probably the most generic machine learning algorithm ...
@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. Maybe try max length of sequence + 100. Use whatever works best for your application.
But then does that mean I can't make predictions at test time with input ...
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 'ImageDataGenerator` class.
Have a look at the execellent documentation!
I won't copy and paste the example from that link, but I can outline the steps that you go through:
You are supposed to pass numpy arrays and not lists as arguments to the DecisionTree, since your input was a list it gets trained as 70 features (1D list) and your test had list of 30 elements and the classifier sees it as 30 features.
Nonetheless, you need to reshape your input numpy array and pass it as a matrix
meaning: X_train.values.reshape(-1, 1) ...
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 stop training.
Testing set: the data points used to check the performance once training is finished.
May training and validation sets overlap?
They should ...
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 df has target/label as [0,1,2] in the ratio say, 40:30:30. That is, for every 100 datasets, you can find 40, 30 and 30 observations of target 0,1 and 2 respectively.
Now when you split this original using the ...
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 can also gradually increase your learning rate over the number of warmup steps.
As far as I know, this has the benefit of slowly starting to tune things like ...
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 also true that an overfit model should perform worse on the test set than a model that isn't overfit. So if you're seeing these numbers, something unusual is going ...
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 training and testing on the same dataset is that you won't realize that your model is overfitting, because the performance of your model on the test set is good. ...
I just hacked together a very basic helper in python
it requires that all images are stored in a pyton list allImages.
import matplotlib.pyplot as plt
for i,image in enumerate(allImages):
It highly depends on the type of game and the information about the state of the game that is available to your AI.
Some of the most famous game playing AIs from last few years are based on deep reinforcement learning (e.g. Playing Atari with Deep Reinforcement Learning), which is normal reinforcement learning (e.g. Q-learning) with a deep neural network as ...
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.
They treat the typical hidden fully connected layer as a convolutional layer. This works because convolutional layers can be thought of as convolving the same ...
Is there any model in machine learning that does not have parameters?
Yes. k-nearest neighbors is parameterless (there is only a single hyper-parameter $k$).
If such parameterless models exist, what are their purpose then? Isn't it the whole point of training to tune a model's parameters?
Exactly: such models require no training at all. k-NN in ...
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 just blank output images would score roughly the same as your network has so far. Your accuracy metric is not meaningful.
The low Dice coefficient score gives ...