Skip to content

Commit

Permalink
fix LRFinder
Browse files Browse the repository at this point in the history
  • Loading branch information
egillax committed Apr 19, 2023
1 parent 935f51d commit f26382e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/LRFinder.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ lrFinder <- function(dataset, modelType, modelParams, estimatorSettings,
divergenceThreshold=4) {
torch::torch_manual_seed(seed=estimatorSettings$seed)
model <- do.call(modelType, modelParams)
model$to(device=estimatorSettings$device)
if (is.function(estimatorSettings$device)) {
device = estimatorSettings$device()
} else {device = estimatorSettings$device}
model$to(device=device)

optimizer <- estimatorSettings$optimizer(model$parameters, lr=minLR)

Expand Down

0 comments on commit f26382e

Please sign in to comment.