I'm working on individual claims reserving and your work is incredible ! Thank you so much for sharing your code.
I came across an error and I can't fix it (is the problem coming from the new version of tfprobabilty or tensorflow or something else ?)
It's related to this lines of code (model.R) :
paid_out <- out_sequence %>%
layer_dense_variational(units = 4,
make_posterior_fn = posterior_mean_field,
make_prior_fn = prior,
kl_weight = 1 / n_rows,
activation = "linear") %>%
layer_distribution_lambda(
function(x) {
d <- tfd_mixture(
cat = tfd_categorical(logits = x[,,1:2]),
components = list(
tfd_transformed_distribution(
tfd_log_normal(x[,,3], 1e-3 + ln_scale_bound * k_sigmoid(scale_c * x[,,4])),
tfb_affine_scalar(shift = -1e-3)
),
tfd_deterministic(loc = k_zeros_like(x[,,3]))
)
)
},
name = "paid_out_"
)
Warning message in tfb_affine_scalar(shift = -0.001):
“tfb_affine_scalar() is deprecated, please use tfb_shift(shift)(tfb_scale(scale))
instead”
Error in py_call_impl(callable, dots$args, dots$keywords): RuntimeError: Exception encountered when calling layer "paid_out_" (type DistributionLambda).
Evaluation error: TypeError: got an unexpected keyword argument 'use_static_graph'
Detailed traceback:
File "/miniconda/envs/r-reticulate/lib/python3.8/site-packages/decorator.py", line 231, in fun
args, kw = fix(args, kw, sig)
File "/miniconda/envs/r-reticulate/lib/python3.8/site-packages/decorator.py", line 203, in fix
ba = sig.bind(*args, **kwargs)
File "/miniconda/envs/r-reticulate/lib/python3.8/inspect.py", line 3037, in bind
return self._bind(args, kwargs)
File "/miniconda/envs/r-reticulate/lib/python3.8/inspect.py", line 3026, in _bind
raise TypeError(
Call arguments received:
• inputs=tf.Tensor(shape=(None, 11, 4), dtype=float32)
• args=<class 'inspect._empty'>
• kwargs={'training': 'None'}