# \donttest{
if (torch::torch_is_installed()) {
# Example: fitting with random data, do not expect to get
# any meaningful results.
# creating example data for fitting:
demography_obj <- demography::demogdata(
data = matrix(runif(10*5), nrow = 10),
pop = matrix(runif(10*5, 1000, 2000), nrow = 10),
ages = 50:59,
years = 2000:2004,
type = "mortality",
name = "male",
label = "France"
)
nn_data <- NNMoMoData(demography_obj)
# fitting the data in 10 epochs (in practice, many more epochs are needed):
fit <- fit(object = lcNN(),
data = nn_data,
fitting.epochs = 10)
plot(fit$France_male)
}
# }
Run the code above in your browser using DataLab