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
0
votes
0 answers

mini-batch gradient decent bad accuracy/loss

I’m trying 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, I’m not certain if I’m calculating the loss as well as the accuracy correctly. Any suggestions on how…
0
votes
0 answers

MiniBatches there are no samples for class label exception

I was following the first example given in Accord.Net framework's documentation here to train a multi class SVM classifier with my own dataset but during the training loop the I got an error that says: There are no samples for class label 3. Please…
0
votes
0 answers

1D perceptron : RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x3 and 1x1)

This is part of my code, a simple 1d and 2 layer perceptron, and I want to implement minibatch. class Net(nn.Module): ## nn.Module class is used def __init__(self): super(Net, self).__init__() self.fc1 =…
0
votes
1 answer

How does Tensorflow Object Detection sample mini-batches?

I try to build an object detection model, as a part of Master's degree project. When we work with neural networks - batch size is an important hyperparameter. From previous questions I learned, that each minibatch is randomly sampled without…
0
votes
1 answer

The optimal way to split Eigen MatrixXd into fixed-size batches with randomly shuffled rows

I have input and target data represented as MatrixXd (N x M) and VectorXd (N). The goal is to create mini-batches of size K consisting of a subset of input and target data shuffled in the same way. Then, the ML model will process these mini-batches…
0
votes
0 answers

how to balance minibatches on keras when training a convolutional neural network?

I am training a convolutional neural network on images (with size 299, 299, 3). The images can have labels: 0, 1 or 2 (multiclass classification), and the 3 classes are very unbalanced. To improve the training phase I want to make sure that each…
mad_
  • 1
  • 1
0
votes
1 answer

How can I use minibatches with a non-variational GPR in gpflow?

I have tried to adapt the instructions in this documentation to use minibatches for a training a GPR model, but nothing I have tried works. I cannot supply the batch iterator to the training_loss_closure method or use a batch iterator for model's…
partyphysics
  • 175
  • 7
0
votes
1 answer

How can I increase the number of mini-batch using the Standard Updater class in Chainer substantially?

How can I increase the number of mini-batch using the Standard Updater class in Chainer substantially? In case of PyTorch, I can increase the number of mini-batch substantially. Execute loss.backward() every time. Execute optimizer.step() /…
0
votes
1 answer

In tensorflow, why is there only one validation loss, when there are many mini-batch of validation data?

In tensorflow, if we provide validation_data in .fit(), we get validation loss. But there is only one validation loss even if the validation dataset has many mini-batches. So I was wondering how tensorflow calculates the loss for validation. For…
Sara
  • 245
  • 4
  • 11
0
votes
1 answer

How to handle samples with multiple images in a pytorch image processing model?

My model training involves encoding multiple variants of a same image then summing the produced representation over all variants for the image. The data loader produces tensor batches of the shape: [batch_size,num_variants,1,height,width]. The 1…
hamza keurti
  • 385
  • 1
  • 2
  • 15
0
votes
1 answer

Difference between the cost function of a training sample and the cost function of a mini-batch

Lets say that I have a neural network named 'NN' with 500 weights and biases (total parameters=500). For one training sample: It's introduced through 'NN', it spits out an output (Out1), the output is compared to the training label, and with the…
Arman Mojaver
  • 352
  • 1
  • 9
0
votes
1 answer

Trying to understand shuffle within mini-batch in tensorflow Dataset

From here I understand what shuffle, batch and repeat do. I'm working on Medical image data where each mini-batch has slices from one patient record. I'm looking for a way to shuffle within the minibatch while training. I cannot increase the buffer…
0
votes
0 answers

When does an agent learn in the Matalb Reinforcement Learning Toolbox?

I'm currently testing the Reinforcement Learning Toolbox in Matlab R2019a. Everything is working well so far, but I stumbled upon a question the documentation couldn't answer satisfyingly: When does the agent learn? The documentation says about the…
0
votes
1 answer

Mini Batching Neural Network

I'm trying to implement mini batching correctly for my own NN. But I can't wrap my head about what's being summed? Do I sum the Gradient or the delta weights (where the learning rate is already multiplied) for the weight and bias which in my…
filip
  • 628
  • 2
  • 8
  • 31
0
votes
1 answer

Understanding what happens during a single epoch of DBOW

I am using Distributed Bag of Words (DBOW) and I'm curious what happens during a single Epoch? Does DBOW cycle through all documents (aka Batch) or does it cycle through a subset of documents (aka Mini-batch)? In addition, for a given document DBOW…