self.reset()
// initialize location vector
l_t = torch.Tensor(self.batch_size, 2).uniform_(-1, 1)
l_t = Variable(l_t)
// extract the glimpses
log_pi = 0.
for t in range(self.num_glimpses - 1):
After Change
log_value("train_loss", losses.avg, epoch)
log_value("train_acc", accs.avg, epoch)
return losses.avg, accs.avg
def validate(self, epoch):
Evaluate the model on the validation set.