Hi @mMagmer, so how would you calculate it in each batch? Could you give an example?
for epoch in n_epochs:
	for local_batch, local_labels in training_generator:
		# Transfer the data to GPU/CPU
		local_batch, local_labels = local_batch.to(device), local_labels.to(device)
		
		# Initialize gradients, zero the parameter gradients
		optimizer.zero_grad()

		# forward pass: compute predicted outputs by passing inputs to the model
		predictions = model(local_batch)
		
		# calculate training accuracy
		predicted_labels = predictions.argmax(dim=1, keepdim=True).squeeze()
		num_train_correct = ????
		train_accuracy = ????
	...```