From dcc4386cce2031ce7de9410087a49f1b8be7f732 Mon Sep 17 00:00:00 2001 From: stefanradev93 Date: Mon, 3 Jun 2024 12:57:56 -0400 Subject: [PATCH] Fix unbuilt status warnings --- bayesflow/experimental/networks/resnet/hidden_block.py | 7 ++++++- bayesflow/experimental/networks/resnet/resnet.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bayesflow/experimental/networks/resnet/hidden_block.py b/bayesflow/experimental/networks/resnet/hidden_block.py index a20af181a..89780fa64 100644 --- a/bayesflow/experimental/networks/resnet/hidden_block.py +++ b/bayesflow/experimental/networks/resnet/hidden_block.py @@ -43,12 +43,17 @@ def call(self, inputs: Tensor, **kwargs): x = x + inputs return self.activation_fn(x) + def build(self, input_shape): + super().build(input_shape) + self(keras.KerasTensor(input_shape)) + def get_config(self): config = super().get_config() config.update({ "residual": self.residual, "spectral_norm": self.spectral_norm, "activation_fn": keras.saving.serialize_keras_object(self.activation_fn), - "dense_with_dropout": keras.saving.serialize_keras_object(self.dense_with_dropout) + "dense": keras.saving.serialize_keras_object(self.dense), + "dropout": keras.saving.serialize_keras_object(self.dropout) }) return config diff --git a/bayesflow/experimental/networks/resnet/resnet.py b/bayesflow/experimental/networks/resnet/resnet.py index 59bee1c56..b20a7acc9 100644 --- a/bayesflow/experimental/networks/resnet/resnet.py +++ b/bayesflow/experimental/networks/resnet/resnet.py @@ -81,3 +81,4 @@ def __init__( def call(self, inputs: Tensor, **kwargs): return self.res_blocks(inputs, **kwargs) +