Skip to content

Commit

Permalink
some minor renaming orthogonal to PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed Jun 8, 2021
1 parent 5ecbe45 commit 5e4a1c2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/test_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ function basictest(ModelType, X, y, builder, optimiser, threshold, accel)
optimiser=$optimiser,
acceleration=$accel_ex)

fitresult, cache, report = MLJBase.fit(model, 0, $X, $y);
fitresult, cache, _report = MLJBase.fit(model, 0, $X, $y);

history = report.training_losses;
history = _report.training_losses;
@test length(history) == model.epochs + 1

# test improvement in training loss:
Expand All @@ -72,7 +72,7 @@ function basictest(ModelType, X, y, builder, optimiser, threshold, accel)
# increase iterations and check update is incremental:
model.epochs = model.epochs + 3

fitresult, cache, report =
fitresult, cache, _report =
@test_logs((:info, r""), # one line of :info per extra epoch
(:info, r""),
(:info, r""),
Expand All @@ -82,7 +82,7 @@ function basictest(ModelType, X, y, builder, optimiser, threshold, accel)

yhat = MLJBase.predict(model, fitresult, $X)

history = report.training_losses;
history = _report.training_losses;
@test length(history) == model.epochs + 1

# start fresh with small epochs:
Expand All @@ -91,18 +91,18 @@ function basictest(ModelType, X, y, builder, optimiser, threshold, accel)
epochs=2,
acceleration=$accel_ex)

fitresult, cache, report = MLJBase.fit(model, 0, $X, $y);
fitresult, cache, _report = MLJBase.fit(model, 0, $X, $y);

# change batch_size and check it performs cold restart:
model.batch_size = 2
fitresult, cache, report =
fitresult, cache, _report =
@test_logs((:info, r""), # one line of :info per extra epoch
(:info, r""),
MLJBase.update(model, 2, fitresult, cache, $X, $y ));

# change learning rate and check it does *not* restart:
model.optimiser.eta /= 2
fitresult, cache, report =
fitresult, cache, _report =
@test_logs(MLJBase.update(model, 2, fitresult, cache, $X, $y));

# set `optimiser_changes_trigger_retraining = true` and change
Expand Down

0 comments on commit 5e4a1c2

Please sign in to comment.