Questions tagged [mini-batch]

Use mini-batch when working with neural networks and in particular with mini-batch stochastic gradient descent.

A mini-batch is a subset of the input data (batch) broken up into many smaller pieces (mini-batch) that are used to train the neural network.

References

84 questions
1
vote
1 answer

Spacy text classification using minibatch

I have a question regarding the minibatching that is used in the example train_textcat.py The main training loop looks like this: for i in range(n_iter): losses = {} # batch up the examples using spaCy's minibatch batches =…
AGH
  • 11
  • 2
1
vote
1 answer

H2O.ai mini_batch_size is really used?

In the documentation of H2O is written: mini_batch_size: Specify a value for the mini-batch size. (Smaller values lead to a better fit; larger values can speed up and generalize better.) but when I run a model using the FLOW UI (with…
1
vote
1 answer

CNTK load pictures with class affiliation in percent

I am trying to build a neuronal network with CNTK to estimate the age of a person. Currently I want to try an approach using only one class. So every picture gets label 0 but also an affiliation to the class in percent. So the net should learn that…
B. Ueno
  • 159
  • 2
  • 13
1
vote
2 answers

Training on minibatches of varying size

I'm trying to train a deep learning model in PyTorch on images that have been bucketed to particular dimensions. I'd like to train my model using mini-batches, but the mini-batch size does not neatly divide the number of examples in each bucket. One…
Roflcakzorz
  • 37
  • 1
  • 6
1
vote
1 answer

Tensorflow: how to use tf.train.batch()

I use Tensorflow (Version 1.7.0 and Python 3.5) for a neural network and have problems using the tf.train.batch() function. See here. The dimensions of my dataset are: Test images (100000, 900) Test labels (100000, 10) So I have 100000 test images…
Gilfoyle
  • 3,282
  • 3
  • 47
  • 83
1
vote
1 answer

Tensorflow overlapping mini batch

given some data in a dataset (or tensor) tensor = tf.constant([1, 2, 3, 4, 5, 6, 7]) i need to create N batches of M tuples by drawing (say 4 x 3) with replacement. an example minibatch could be [[1 2 3], [3, 4 5], [2, 3, 4], [5, 6, 7]] The aim is…
Roman
  • 31
  • 2
1
vote
0 answers

How to feed mini-batch without leading to OOM?

I apologize that I'm not pretty good at English. Well..I'm trying to feed my own data, which contain 4,000 images, to given placeholder. For example, from PIL import Image class dataset(): def __init__(self): self.data = [] for…
James
  • 13
  • 4
1
vote
0 answers

How to add new values of categorical features in Tensorflow?

Let's say we are using mini-batch gradient descent in tensorflow. Everyday I update last day's model to predict something(regression/classification) by feeding new data to the model. What do I do if a new value for a categorical feature shows up?…
0
votes
0 answers

Adaptation of a logistic regresion binary classifier with grandient descent and mini batch for one vs rest technique

I am using a created algorithm of logistic regresion binary classifier with grandient descent and mini batch to create and adaptation valid for multiple clases with one vs rest technique, but when I do a test with a sklearn dataset the score is very…
0
votes
1 answer

Logistic Regresion with gradient descension mini batch

I developed an algorithm of gradient descent, but when I try it with some sklearn exampples the results are incorrect and I do not know how to fix it. This is the full algorithm: First of all I have a class for an exception and a function to…
0
votes
0 answers

How to create mini-batches of predefined sizes from a sparse 2D matrix in Python?

I have a sparse 2D matrix saved on a disk (.npz extension) that I've created in preprocessing step with scipy.sparse.csr_matrix. It is a long sequence of piano-roll (a numerical form of MIDI representation) format 1-channel image. I cannot convert…
Mateusz Dorobek
  • 702
  • 1
  • 6
  • 22
0
votes
0 answers

Training a Large Graph Neural Network for Time Series Traffic Prediction Problem

I am training a GNN (GCN+GRU) for traffic prediction problem using pygeometric, my project is like the example shown in the official…
0
votes
0 answers

Is there an issue in implementing the mini-batch algorithm in this code?

I am reading an example of minibatch training algorithm, but I feel it is wrong in updating the weights. The code is below: batch_size = 10 alpha, iterations = 0.001, 300 pixels_per_image, num_labels, hidden_size = 784, 10, 100 weights_0_1 =…
marlon
  • 6,029
  • 8
  • 42
  • 76
0
votes
0 answers

I am trying to get Matlab Minibatchqueue to spit out 500 rows per column, from a 16 columns (variable ds) at a time

I have an EEG with 16 chanel. It is organized in a table using TabularTextDatastore. 16 columns, one per chanel. I want to organize the data in minibatchs 500x16 datapoints. Each datapoint count for a signal mesuments at 1 sec interval. ds[100000 X…
0
votes
1 answer

mini-batch gradient descent, loss doesn't improve and accuracy very low

I’m trying to implement mini-batch gradient descent on the popular iris dataset, but somehow I don’t manage to get the accuracy of the model above 75-80%. Also the loss does not decrease and is rather stuck at around 0.45, even when I set the number…