In the previous version of the code, during hyper gradient descent if the change in deltas from iteration i to i+1 is small then model fitting for that batch ends early, and cv_scores is truncated to be i+1 x num_targets. However, if batching is used during model fitting then the cv_score truncation causes an error (The entire num_iters x num_targets matrix is truncated to i+1 x num_targets. This causes indexing issues because other batches may still need the full num_iters length matrix).
I changed the code to set cv_scores[i+1:, batch] to be cv_scores[i:, batch], since the batchdeltas for iteration i+1 onwards are not updated, and therefore the cv_scores would not change for that batch after iteration i.
In the previous version of the code, during hyper gradient descent if the change in
deltas
from iterationi
toi+1
is small then model fitting for that batch ends early, andcv_scores
is truncated to bei+1 x num_targets
. However, if batching is used during model fitting then thecv_score
truncation causes an error (The entirenum_iters x num_targets
matrix is truncated toi+1 x num_targets
. This causes indexing issues because other batches may still need the fullnum_iters
length matrix).I changed the code to set
cv_scores[i+1:, batch]
to becv_scores[i:, batch]
, since thebatch
deltas
for iterationi+1
onwards are not updated, and therefore thecv_scores
would not change for that batch after iterationi
.