Consider the following two algorithms with regards to the constructing the dataset loader:
- Before looping through the training epochs
- Within the loop for each epoch
Does the first algorithm have a SIGNIFICANT advantage over the second one?
Consider the following two algorithms with regards to the constructing the dataset loader:
Does the first algorithm have a SIGNIFICANT advantage over the second one?
In general: No it hasn’t. However, I try to reduce repeatedly executed code to a necessary minimum. Saying that I usually initialize it before the loop since there are no disadvantages doing so.