tests/testthat/test_6_opt.R

context("optimisation")

modello.reset()

tol = 1e-3

test_that("'optimisers' works", {
    expect_lt(test.opt(sgd.opt, 0.0001, 1000000), tol)
    expect_lt(test.opt(sgdwm.opt, 0.0001, 0.99, 1000000), tol)
    expect_lt(test.opt(adam.opt, 0.0001, 0.99, 0.8, 1000000), tol)
})

Try the modello package in your browser

Any scripts or data that you put into this service are public.

modello documentation built on Feb. 2, 2021, 9:06 a.m.