diff --git a/codes/ipython/1-basics/models.ipynb b/codes/ipython/1-basics/models.ipynb index 4cfe8d7..061bbcb 100644 --- a/codes/ipython/1-basics/models.ipynb +++ b/codes/ipython/1-basics/models.ipynb @@ -185,7 +185,7 @@ "\n", " def call(self, inputs):\n", " x = self.layer_1(inputs)\n", - " out = self.layer_2(inputs)\n", + " out = self.layer_2(x)\n", " return out\n", "\n", "# Create model\n", @@ -208,11 +208,11 @@ "text": [ "Output shape: (1, 32)\n", "Model name: custom_model\n", - "Number of trainable variables: 192\n" + "Number of trainable variables: 608\n" ], "name": "stdout" } ] } ] -} \ No newline at end of file +} diff --git a/codes/python/1-basics/models.py b/codes/python/1-basics/models.py index cb5eccc..b318e10 100644 --- a/codes/python/1-basics/models.py +++ b/codes/python/1-basics/models.py @@ -86,7 +86,7 @@ def __init__(self): def call(self, inputs): x = self.layer_1(inputs) - out = self.layer_2(inputs) + out = self.layer_2(x) return out # Create model @@ -100,4 +100,4 @@ def call(self, inputs): # Count total trainable variables total_trainable_var = np.sum([tf.size(var).numpy() for var in custom_model.trainable_variables]) -print("Number of trainable variables:", total_trainable_var) \ No newline at end of file +print("Number of trainable variables:", total_trainable_var)